<commit_before>
var Zugmaschine = require('../utils/zugmaschine').Zugmaschine;

var Time = function(config){
  this.zm = new Zugmaschine(config);
  this.config = config;
};

Time.prototype.find = function(id, tid, cb){
  this.zm.options.method = 'GET';
  this.zm.options.path = '/api/v1/projects/' + id +
                 '/tickets/' + tid +
                 '/time_entries';

  this.zm.exec(this.zm.options,function(data, err){
    cb(data || [],err);
  });

};

Time.prototype.findOne = function(id, tid, pid, cb){

  this.zm.options.method = 'GET';
  this.zm.options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries' + id;

  this.zm.exec(this.zm.options,function(data, err){
    cb(data,err);
  });

};

Time.prototype.findOne = function(id, tid, pid, cb){

  var zm = new Zugmaschine(this.config);
  var options =  zm.options;
  options.method = 'GET';
  options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries/' + id;

  zm.exec(options,function(data, err){
    cb(data,err);
  });

};

Time.prototype.insert = function(time, tid, pid, cb){

  var zm = new Zugmaschine(this.config);
  var options =  zm.options;
  options.method = 'POST';
  options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries/' + time.id;
  options.body = time;

  zm.exec(options,function(data, err){
    cb(data,err);
  });

};

Time.prototype.update = function(time, tid, pid, cb){

  var zm = new Zugmaschine(this.config);
  var options =  zm.options;
  options.method = 'PUT';
  options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries/' + time.id;
  options.body = time;

  zm.exec(options,function(data, err){
    cb(data,err);
  });

};

exports.Time = Time;<commit_msg>Refactoring time<commit_after>
var Zugmaschine = require('../utils/zugmaschine').Zugmaschine;

var Time = function(config){
  this.zm = new Zugmaschine(config);
  this.config = config;
};

Time.prototype.find = function(id, tid, cb){
  this.zm.options.method = 'GET';
  this.zm.options.path = '/api/v1/projects/' + id +
                 '/tickets/' + tid +
                 '/time_entries';

  this.zm.exec(this.zm.options,function(data, err){
    cb(data || [],err);
  });

};

Time.prototype.findOne = function(id, tid, pid, cb){

  this.zm.options.method = 'GET';
  this.zm.options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries' + id;

  this.zm.exec(this.zm.options,function(data, err){
    cb(data,err);
  });

};

Time.prototype.findOne = function(id, tid, pid, cb){

  this.zm.options.method = 'GET';
  this.zm.options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries/' + id;

  this.zm.exec(this.zm.options,function(data, err){
    cb(data,err);
  });

};

Time.prototype.insert = function(time, tid, pid, cb){

  this.zm.options.method = 'POST';
  this.zm.options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries/' + time.id;
  this.zm.options.body = time;

  this.zm.exec(this.zm.options,function(data, err){
    cb(data,err);
  });

};

Time.prototype.update = function(time, tid, pid, cb){

  this.zm.options.method = 'PUT';
  this.zm.options.path = '/api/v1/projects/' + pid +
                 '/tickets/' + tid +
                 '/time_entries/' + time.id;
  this.zm.options.body = time;

  this.zm.exec(this.zm.options,function(data, err){
    cb(data,err);
  });

};

exports.Time = Time;
{'fraction_non_alphanumeric': 0.18493150684931506, 'fraction_numerical': 0.0027397260273972603, 'mean_word_length': 2.352617079889807, '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': '5766114', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1285, 'n_words': 225}