<commit_before>var AlphaReportService = require('../database/alpha_report.js');
var general = require('../general_response');

module.exports = function(app, models, io, logger) {
	var me = this;

	me.logger = logger;
	me.models = models;
	me.app = app;
	me.io = io;

	var alphaReportService = new AlphaReportService(models, io, logger);

		//list all fields of all alpha reports
	app.get('/alpha-report/?', function(req,res){
		if(logger.DO_LOG){
			logger.info('Request for a list of all alpha reports');
		}
		var params = {};

		alphaReportService.list(params, function(err, docs, config){
			if(err){
				logger.info("Error listing alpha reports " + err);
				responseHandler.send500(res, "Error listing alpha reports");
			} else {
				alphaReportService.getTotalCount(config, function(err, numDocs){
					if (err){
						me.logger.error("Assertion: "+err, err);
						responseHandler.send500(res, "Error getting count of alpha reports");
					} else {
						res.jsonp({alpha-reports: docs, total_count: numDocs});
						res.end();
					}
				});
			}
		});
	});
	
	app.get('/alpha-report/indexes', function(req, res){
		if(logger.DO_LOG){
			logger.info('Request for list of indexes for alpha report');
			
			alphaReportService.getIndexes(req.query, function(indexes){
				if (!indexes){<commit_msg>hyphen error<commit_after>var AlphaReportService = require('../database/alpha_report.js');
var general = require('../general_response');

module.exports = function(app, models, io, logger) {
	var me = this;

	me.logger = logger;
	me.models = models;
	me.app = app;
	me.io = io;

	var alphaReportService = new AlphaReportService(models, io, logger);

		//list all fields of all alpha reports
	app.get('/alpha-report/?', function(req,res){
		if(logger.DO_LOG){
			logger.info('Request for a list of all alpha reports');
		}
		var params = {};

		alphaReportService.list(params, function(err, docs, config){
			if(err){
				logger.info("Error listing alpha reports " + err);
				responseHandler.send500(res, "Error listing alpha reports");
			} else {
				alphaReportService.getTotalCount(config, function(err, numDocs){
					if (err){
						me.logger.error("Assertion: "+err, err);
						responseHandler.send500(res, "Error getting count of alpha reports");
					} else {
						res.jsonp({alpha_reports: docs, total_count: numDocs});
						res.end();
					}
				});
			}
		});
	});
	
	app.get('/alpha-report/indexes', function(req, res){
		if(logger.DO_LOG){
			logger.info('Request for list of indexes for alpha report');
			
			alphaReportService.getIndexes(req.query, function(indexes){
				if (!indexes){
{'fraction_non_alphanumeric': 0.1488710294680444, 'fraction_numerical': 0.004592422502870264, 'mean_word_length': 3.761384335154827, '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': '1855705', 'n_tokens_mistral': 986, 'n_tokens_neox': 816, 'n_words': 202}