<commit_before>angular.module('main', ['ngRoute'])

	.factory('Projects', function($q, $http) {
		var getProjects = function() {
			var deferred = $q.defer();

			$http.get('/projects/list').success(function(projects) {
				deferred.resolve(projects);
			});

			return deferred.promise;
		};

		return {
			getProjects: getProjects
		};
	})

	.factory('Sprints', function($q, $http) {
		var getSprints = function(projectId) {
			var deferred = $q.defer();

			$http.get('/projects/' + projectId + '/sprints/list').success(function(sprints) {
				deferred.resolve(sprints);
			});

			return deferred.promise;
		};

		var analyzeSprint = function(projectId, sprintId) {
			var deferred = $q.defer();

			$http.get('/projects/' + projectId + '/sprints/' + sprintId + '/analyze').success(function(statictics) {
				deferred.resolve(statictics);
			});

			return deferred.promise;
		};

		return {
			getSprints: getSprints,
			analyzeSprint: analyzeSprint
		};
	})

	.factory('Socket', function($rootScope) {
		var socket = io.connect();

		var applyCallback = function(arguments, callback) {
			$rootScope.$apply(function() {
				callback.apply(socket, arguments);
			});
		};
		var on = function(event, callback) {
			socket.on(event, function() {
				applyCallback(arguments, callback);
			});
		};
		var emit = function(event, data, callback) {
			socket.emit(event, data, function() {
				applyCallback(arguments, callback);
			});
		};

		return {
			'on': on,
			'emit': emit
		};
	})

	.config(function($routeProvider) {
		$routeProvider
			.when('/', {
				controller: 'ProjectListController',
				templateUrl: '/html/project-list.html'
			})
			.when('/project/:projectId', {
				controller: 'SprintListController',
				templateUrl: '/html/sprint-list.html'
			})
			.when('/projects/:projectId/sprints/:sprintId', {
				controller: 'SprintAnalyzeController',
				templateUrl: '/html/sprint-analyze.html'
			})
			.otherwise({
				redirectTo: '/'
			});
	})

	.controller('ProjectListController', function($scope, Projects) {
		$scope.loading = true;
		Projects.getProjects().then(function(projects) {
			$scope.projects = projects;
			$scope.loading = false;
		});
	})

	.controller('SprintListController', function($scope, $routeParams, Sprints) {
		$scope.loading = true;
		Sprints.getSprints($routeParams.projectId).then(function(sprints) {
			$scope.projectId = $routeParams.projectId;
			$scope.sprints = sprints;
			$scope.loading = false;
		});
	})

	.controller('SprintAnalyzeController', function($scope, $routeParams, Sprints, Socket) {
		$scope.loading = true;
		Sprints.analyzeSprint($routeParams.projectId, $routeParams.sprintId).then(function(statistics) {
			var labels = [];
			for (var name in statistics.labels) {
				labels.push({
					'name': name,
					'value': statistics.labels[name]
				})
			}

			var numbers = [
				{
					'name': 'All Issues',
					'value': statistics.numIssuesAll
				},
				{
					'name': 'Issues Completed',
					'value': statistics.numIssuesCompleted
				},
				{
					'name': 'Issues Incomplete',
					'value': statistics.numIssuesIncomplete
				},
				{
					'name': 'Issues Added During Sprint',
					'value': statistics.numIssuesAddedDuringSprint
				},
				{
					'name': 'Issues Completed Added During Sprint',
					'value': statistics.numIssuesCompletedAddedDuringSprint
				}
			];

			$scope.labels = labels;
			$scope.numbers = numbers;
			$scope.numIssuesWithoutLabel = statistics.numIssuesWithoutLabel;
			$scope.loading = false;
		});
	});<commit_msg>show incomplete issues that were added during the sprint<commit_after>angular.module('main', ['ngRoute'])

	.factory('Projects', function($q, $http) {
		var getProjects = function() {
			var deferred = $q.defer();

			$http.get('/projects/list').success(function(projects) {
				deferred.resolve(projects);
			});

			return deferred.promise;
		};

		return {
			getProjects: getProjects
		};
	})

	.factory('Sprints', function($q, $http) {
		var getSprints = function(projectId) {
			var deferred = $q.defer();

			$http.get('/projects/' + projectId + '/sprints/list').success(function(sprints) {
				deferred.resolve(sprints);
			});

			return deferred.promise;
		};

		var analyzeSprint = function(projectId, sprintId) {
			var deferred = $q.defer();

			$http.get('/projects/' + projectId + '/sprints/' + sprintId + '/analyze').success(function(statictics) {
				deferred.resolve(statictics);
			});

			return deferred.promise;
		};

		return {
			getSprints: getSprints,
			analyzeSprint: analyzeSprint
		};
	})

	.factory('Socket', function($rootScope) {
		var socket = io.connect();

		var applyCallback = function(arguments, callback) {
			$rootScope.$apply(function() {
				callback.apply(socket, arguments);
			});
		};
		var on = function(event, callback) {
			socket.on(event, function() {
				applyCallback(arguments, callback);
			});
		};
		var emit = function(event, data, callback) {
			socket.emit(event, data, function() {
				applyCallback(arguments, callback);
			});
		};

		return {
			'on': on,
			'emit': emit
		};
	})

	.config(function($routeProvider) {
		$routeProvider
			.when('/', {
				controller: 'ProjectListController',
				templateUrl: '/html/project-list.html'
			})
			.when('/project/:projectId', {
				controller: 'SprintListController',
				templateUrl: '/html/sprint-list.html'
			})
			.when('/projects/:projectId/sprints/:sprintId', {
				controller: 'SprintAnalyzeController',
				templateUrl: '/html/sprint-analyze.html'
			})
			.otherwise({
				redirectTo: '/'
			});
	})

	.controller('ProjectListController', function($scope, Projects) {
		$scope.loading = true;
		Projects.getProjects().then(function(projects) {
			$scope.projects = projects;
			$scope.loading = false;
		});
	})

	.controller('SprintListController', function($scope, $routeParams, Sprints) {
		$scope.loading = true;
		Sprints.getSprints($routeParams.projectId).then(function(sprints) {
			$scope.projectId = $routeParams.projectId;
			$scope.sprints = sprints;
			$scope.loading = false;
		});
	})

	.controller('SprintAnalyzeController', function($scope, $routeParams, Sprints, Socket) {
		$scope.loading = true;
		Sprints.analyzeSprint($routeParams.projectId, $routeParams.sprintId).then(function(statistics) {
			var labels = [];
			for (var name in statistics.labels) {
				labels.push({
					'name': name,
					'value': statistics.labels[name]
				})
			}

			var numbers = [
				{
					'name': 'All Issues',
					'value': statistics.numIssuesAll
				},
				{
					'name': 'Issues Completed',
					'value': statistics.numIssuesCompleted
				},
				{
					'name': 'Issues Incomplete',
					'value': statistics.numIssuesIncomplete
				},
				{
					'name': 'Issues Added During Sprint',
					'value': statistics.numIssuesAddedDuringSprint
				},
				{
					'name': 'Issues Completed Added During Sprint',
					'value': statistics.numIssuesCompletedAddedDuringSprint
				},
				{
					'name': 'Issues Incomplete Added During Sprint',
					'value': statistics.numIssuesAddedDuringSprint - statistics.numIssuesCompletedAddedDuringSprint
				}
			];

			$scope.labels = labels;
			$scope.numbers = numbers;
			$scope.numIssuesWithoutLabel = statistics.numIssuesWithoutLabel;
			$scope.loading = false;
		});
	});
{'fraction_non_alphanumeric': 0.15915667631252584, 'fraction_numerical': 0.0, 'mean_word_length': 3.559045226130653, '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': '3985742', 'n_tokens_mistral': 2877, 'n_tokens_neox': 2307, 'n_words': 399}