<commit_before>var async         = require('async')
  , fs            = require('fs')
  , mongoose      = require('mongoose')
  , Schema        = mongoose.Schema
  , mongoenabled  = true
  , CommentSchema = new Schema({
      post_id   : {type: String, require: true},
      username  : {type: String, require: true},
      comment   : {type: String, require: true},
      insertdate: {type: Date, require: true}
  })
  , Comment       = mongoose.model('Comment', CommentSchema);

// The file containing posts data
var jsonfile      = 'notes.json';

// So that jade views are loaded from:
// __dirname + /relativeviews + /notes
var viewdir       = 'notes';
var relativeviews = '../../../views';

// Mongodb connection parameters
var mongoconf      = 'mongodb://127.0.0.1/Comments';

/*
 * @brief Connects to mongo
 * @args env Connection string i.e. mongoconf
 *
 */
exports.mongod = function(env, start) {
  if (start == 'no') {
    mongoenabled = false;
    return;
  }

  mongoose.connect(env);
  mongoose.connection.on('open', function() {
    console.log('Mongodb connected');
  });
}

/*
 * @brief Renders notes index
 * @params res - http response
 *<commit_msg>Conditional inclusion / workaround of Openshift bug<commit_after>var async         = require('async')
  , fs            = require('fs')
  , mongoose      = ''
  , Schema        = ''
  , mongoenabled  = ''
  , CommentSchema = ''
  , Comment       = '';

// The file containing posts data
var jsonfile      = 'notes.json';

// So that jade views are loaded from:
// __dirname + /relativeviews + /notes
var viewdir       = 'notes';
var relativeviews = '../../../views';

// Mongodb connection parameters
var mongoconf      = 'mongodb://127.0.0.1/Comments';

/*
 * @brief Connects to mongo
 * @args env Connection string i.e. mongoconf
 *
 */
exports.mongod = function(env, start) {
  if (start == 'no') {
    mongoenabled = false;
    return;
  }

  var mongoose      = require('mongoose')
    , Schema        = mongoose.Schema
    , mongoenabled  = true
    , CommentSchema = new Schema({
        post_id   : {type: String, require: true},
        username  : {type: String, require: true},
        comment   : {type: String, require: true},
        insertdate: {type: Date, require: true}
    })
    , Comment       = mongoose.model('Comment', CommentSchema);

  mongoose.connect(env);
  mongoose.connection.on('open', function() {
    console.log('Mongodb connected');
  });
}

/*
 * @brief Renders notes index
 * @params res - http response
 *
{'fraction_non_alphanumeric': 0.14524472741742936, 'fraction_numerical': 0.00477516912057302, 'mean_word_length': 2.5609065155807365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3161199', 'n_tokens_mistral': 783, 'n_tokens_neox': 780, 'n_words': 209}