<commit_before>'use strict';

class Earthquakes {
  constructor(earthquakes){
    this.earthquakes = earthquakes;
    this.earthquakes30Days = [];
    this.earthquakes7Days = [];
    this.earthquakes24 = [];
    this.earthquakesHour = [];
    this.largestYet = {};
    this.largestYet30 = {};
  }

  getNumberOfQuakes(num) {
    console.log("get number of quakes");
    var quakes = [];
    switch (num){
      case 1:
        quakes = this.getLastTwentyFourHours();
        break;
      case 7:
        quakes = this.getLastSevenDays();
        break;
      case 30:
        quakes = this.getLastThirtyDays();
        break;
      case 60:
        quakes = this.getLastHour();
        break;
      default:
        quakes = this.earthquakes;
    }
    console.log(quakes.length);
    return quakes.length;
  }

  sortQuakes(length) {
    var quakes = [];
    this.earthquakes.forEach(function(quake) {
      if (new Date(quake.time) >= length){
        quakes.push(quake);
      }
    });
    return quakes;
  }

  getLargestQuake(days){
    // Check the cache
    if (days === 7 && this.largestYet.time) {
      return this.largestYet;
    } else if (days == 30 && this.largestYet30.time) {
      return this.largestYet30;
    }

    // Fetch the appropriate data<commit_msg>Adds getter for all earthqakes<commit_after>'use strict';

class Earthquakes {
  constructor(earthquakes){
    this.earthquakes = earthquakes;
    this.earthquakes30Days = [];
    this.earthquakes7Days = [];
    this.earthquakes24 = [];
    this.earthquakesHour = [];
    this.largestYet = {};
    this.largestYet30 = {};
  }

  getNumberOfQuakes(num) {
    console.log("get number of quakes");
    var quakes = [];
    switch (num){
      case 1:
        quakes = this.getLastTwentyFourHours();
        break;
      case 7:
        quakes = this.getLastSevenDays();
        break;
      case 30:
        quakes = this.getLastThirtyDays();
        break;
      case 60:
        quakes = this.getLastHour();
        break;
      default:
        quakes = this.earthquakes;
    }
    console.log(quakes.length);
    return quakes.length;
  }

  sortQuakes(length) {
    var quakes = [];
    this.earthquakes.forEach(function(quake) {
      if (new Date(quake.time) >= length){
        quakes.push(quake);
      }
    });
    return quakes;
  }

  getEarthQuakes() {
    return this.earthquakes;
  }

  getLargestQuake(days){
    // Check the cache
    if (days === 7 && this.largestYet.time) {
      return this.largestYet;
    } else if (days == 30 && this.largestYet30.time) {
      return this.largestYet30;
    }

    // Fetch the appropriate data
{'fraction_non_alphanumeric': 0.12718964204112718, 'fraction_numerical': 0.015232292460015232, 'mean_word_length': 2.259305210918114, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3178903', 'n_tokens_mistral': 952, 'n_tokens_neox': 856, 'n_words': 166}