<commit_before>'use strict';

function Fraction(n, d) {
  if (n % d == 0) {
    this.n = n / d;
    this.d = 1;
    return;
  }

  // REVIEW
  // WHAT IS THIS???
  for (var i = d; i >= 2; i--) {
    if (n % i == 0 && d % i == 0) {
      this.n = n / i;
      this.d = d / i;
      return;
    }
  }

  this.n = n;
  this.d = d;
}

Fraction.prototype.numerator = function () {
  return this.n;
};

Fraction.prototype.denominator = function () {
  return this.d;
};

Fraction.prototype.add = function (fraction) {
  if (this.d === fraction.d) {
    return new Fraction(this.n + fraction.n, this.d);<commit_msg>added biggestCommonDivisor function<commit_after>'use strict';

function findBiggestCommonDivisor(n, d) {
  for (var i = d; i >= 2; i--) {
    if (n % i == 0 && d % i == 0) {
      return i;
    }
  }
  return 0;  
}

function Fraction(n, d) {
  if (n % d == 0) {
    this.n = n / d;
    this.d = 1;
    return;
  }

  var biggestCommonDivisor = findBiggestCommonDivisor(n,d);
  if (biggestCommonDivisor > 0){ 
      this.n = n / biggestCommonDivisor;
      this.d = d / biggestCommonDivisor;
      return;
  }

  this.n = n;
  this.d = d;
}

Fraction.prototype.numerator = function () {
  return this.n;
};

Fraction.prototype.denominator = function () {
  return this.d;
};

Fraction.prototype.add = function (fraction) {
  if (this.d === fraction.d) {
    return new Fraction(this.n + fraction.n, this.d);
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.00847457627118644, 'mean_word_length': 2.3185011709601873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1748442', 'n_tokens_mistral': 574, 'n_tokens_neox': 547, 'n_words': 136}