<commit_before>import { Injectable } from '@angular/core';
import { BreakageInfo } from './objects/breakageInfo';
import { AngularFireDatabase, FirebaseListObservable} from 'angularfire2/database';


@Injectable()
export class BoatBreakageService {
  public items: BreakageInfo[] =[];
  public recentItems: BreakageInfo[] =[];
  public fixedItems: BreakageInfo[] =[];

  private itemsData: FirebaseListObservable<BreakageInfo[]>;
  private recentThreeItems: FirebaseListObservable<BreakageInfo[]>;
  private fixedItemsData: FirebaseListObservable<BreakageInfo[]>;

  constructor(private db: AngularFireDatabase) {
    this.itemsData = db.list('/issues');
    this.itemsData.subscribe(val => { this.buildBreakages(val,this.items); });
    this.recentThreeItems = db.list('/issues', {
      query: {
        limitToLast: 3,
        orderByChild: 'timestamp'
      }
    })
    this.recentThreeItems.subscribe(val => { this.buildBreakages(val, this.recentItems); });
    this.fixedItemsData = db.list('/fixed');
    this.fixedItemsData.subscribe(val => { this.buildBreakages(val,this.fixedItems); });
  }

  addBreakageInfo(breakage: BreakageInfo) {
    return Promise.resolve(this.itemsData.push(
      {
        name: breakage.name,<commit_msg>keep track of nonmodified data<commit_after>import { Injectable } from '@angular/core';
import { BreakageInfo } from './objects/breakageInfo';
import { AngularFireDatabase, FirebaseListObservable} from 'angularfire2/database';


@Injectable()
export class BoatBreakageService {
  public items: BreakageInfo[] =[];
  public original: BreakageInfo[] =[];
  public recentItems: BreakageInfo[] =[];
  public fixedItems: BreakageInfo[] =[];
  public fixedItemsOriginal: BreakageInfo[] =[];

  private itemsData: FirebaseListObservable<BreakageInfo[]>;
  private recentThreeItems: FirebaseListObservable<BreakageInfo[]>;
  private fixedItemsData: FirebaseListObservable<BreakageInfo[]>;

  constructor(private db: AngularFireDatabase) {
    this.itemsData = db.list('/issues');
    this.itemsData.subscribe(val => { this.buildBreakages(val,this.items); });
    this.itemsData.subscribe(val => { this.buildBreakages(val,this.original); });
    this.recentThreeItems = db.list('/issues', {
      query: {
        limitToLast: 3,
        orderByChild: 'timestamp'
      }
    })
    this.recentThreeItems.subscribe(val => { this.buildBreakages(val, this.recentItems); });
    this.fixedItemsData = db.list('/fixed');
    this.fixedItemsData.subscribe(val => { this.buildBreakages(val,this.fixedItems); });
    this.fixedItemsData.subscribe(val => { this.buildBreakages(val,this.fixedItemsOriginal); });
  }

  addBreakageInfo(breakage: BreakageInfo) {
    return Promise.resolve(this.itemsData.push(
      {
        name: breakage.name,
{'fraction_non_alphanumeric': 0.1371841155234657, 'fraction_numerical': 0.001444043321299639, 'mean_word_length': 4.809224318658281, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '4018829', 'n_tokens_mistral': 831, 'n_tokens_neox': 818, 'n_words': 137}