<commit_before>var request = require('request');

function mkReqOpts(opts){
  var newOpts = {
    uri: 'http://achecker.ca/checkacc.php',
    qs: {
      uri:opts.uri,
      id:opts.id,
      output:opts.output || 'html',
      guide: opts.guide || 'WCAG2-AA',
      offset: opts.offset || 0
    }
  }

  return newOpts;
}

module.exports = function(opts, callback){

  if(!opts.uri || !opts.id){
    return callback(new Error('Missing required params.'), null);
  }

  var reqOpts = mkReqOpts(opts);

  request(reqOpts, function(error, response, body){
    if(error) {
      return callback(error, null);
    }
    return callback(null, body);
  });
}<commit_msg>Splits check for required params<commit_after>var request = require('request');

function mkReqOpts(opts){
  var newOpts = {
    uri: 'http://achecker.ca/checkacc.php',
    qs: {
      uri:opts.uri,
      id:opts.id,
      output:opts.output || 'html',
      guide: opts.guide || 'WCAG2-AA',
      offset: opts.offset || 0
    }
  }

  return newOpts;
}

module.exports = function(opts, callback){

  if(!opts.uri){
    return callback(new Error('Missing required param: uri'), null);
  }
/*
  if(!opts.id){
    return callback(new Error('Missing required params.'), null);
  }
*/
  var reqOpts = mkReqOpts(opts);

  request(reqOpts, function(error, response, body){
    if(error) {
      return callback(error, null);
    }
    return callback(null, body);
  });
}
{'fraction_non_alphanumeric': 0.1602519244226732, 'fraction_numerical': 0.0027991602519244225, 'mean_word_length': 3.0509915014164304, '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': '4831436', 'n_tokens_mistral': 488, 'n_tokens_neox': 484, 'n_words': 105}