<commit_before>var mongoose = require('mongoose');
var bcrypt   = require('bcrypt-nodejs');

var userSchema = mongoose.Schema({

    local            : {
        email        : String,
        password     : String
    },
    arrayExercises : {
    	exercise1  : Boolean,
    	exercise2  : Boolean,
    	exercise3  : Boolean,
    	exercise4  : Boolean,
    	exercise5  : Boolean,
    	exercise6  : Boolean,
    	exercise7  : Boolean,
    	exercise8  : Boolean,
    	exercise9  : Boolean,
    	exercise10 : Boolean
    },
    mathExercises  : {
    	exercise1  : Boolean,
    	exercise2  : Boolean,
    	exercise3  : Boolean,
    	exercise4  : Boolean,
    	exercise5  : Boolean,
    	exercise6  : Boolean,
    	exercise7  : Boolean,
    	exercise8  : Boolean,
    	exercise9  : Boolean,
    	exercise10 : Boolean
    }
});

userSchema.methods.generateHash = function(password) {
    return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
};

// checking if password is valid
userSchema.methods.validPassword = function(password) {
    return bcrypt.compareSync(password, this.local.password);
};

// create the model for users and expose it to our app
module.exports = mongoose.model('User', userSchema);<commit_msg>fix eslint problems in user.js. File now clean<commit_after>var mongoose = require('mongoose');
var bcrypt = require('bcrypt-nodejs');

var userSchema = mongoose.Schema({

  local: {
    email: String,
    password: String
  },
  arrayExercises: {
    exercise1: Boolean,
    exercise2: Boolean,
    exercise3: Boolean,
    exercise4: Boolean,
    exercise5: Boolean,
    exercise6: Boolean,
    exercise7: Boolean,
    exercise8: Boolean,
    exercise9: Boolean,
    exercise10: Boolean
  },
  mathExercises: {
    exercise1: Boolean,
    exercise2: Boolean,
    exercise3: Boolean,
    exercise4: Boolean,
    exercise5: Boolean,
    exercise6: Boolean,
    exercise7: Boolean,
    exercise8: Boolean,
    exercise9: Boolean,
    exercise10: Boolean
  }
});

userSchema.methods.generateHash = function(password) {
  return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
};

// checking if password is valid
userSchema.methods.validPassword = function(password) {
  return bcrypt.compareSync(password, this.local.password);
};

// create the model for users and expose it to our app
module.exports = mongoose.model('User', userSchema);
{'fraction_non_alphanumeric': 0.10215280709159984, 'fraction_numerical': 0.019417475728155338, 'mean_word_length': 3.0721649484536084, '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': '7170080', 'n_tokens_mistral': 745, 'n_tokens_neox': 724, 'n_words': 178}