<commit_before>App.InsightController = Em.ObjectController.extend({
  needs: "query"
});

App.Insight = DS.Model.extend({

  limit: DS.attr('number', {defaultValue:10}),
  content: DS.attr('string'),
  
  spec: function(){
    return JSON.parse(this.get('content'));
  }.property('content'),

  columns: function(){
    return this.get('spec.columns');
  }.property('spec'),

  name: function(){
    return this.get('spec.name');
  }.property('spec'),

  isTemp: function(){
    return this.get('id') == 'temp';
  }.property('id')

});

App.Insight.FIXTURES = [{
  id: 1,
  name: "Google Analytics"
},{
  id: 2,
  name: "Size Histogram"
}]<commit_msg>Don't fail if we can't parse the vega spec file.<commit_after>App.InsightController = Em.ObjectController.extend({
  needs: "query"
});

App.Insight = DS.Model.extend({

  limit: DS.attr('number', {defaultValue:10}),
  content: DS.attr('string'),
  
  spec: function(){
    var spec;
    try{
      spec = JSON.parse(this.get('content'));
    }catch(e){
      spec = {}
    }

    return spec;
  }.property('content'),

  columns: function(){
    return this.get('spec.columns');
  }.property('spec'),

  name: function(){
    return this.get('spec.name');
  }.property('spec'),

  isTemp: function(){
    return this.get('id') == 'temp';
  }.property('id')

});

App.Insight.FIXTURES = [{
  id: 1,
  name: "Google Analytics"
},{
  id: 2,
  name: "Size Histogram"
}]
{'fraction_non_alphanumeric': 0.205363443895554, 'fraction_numerical': 0.0056457304163726185, 'mean_word_length': 3.6188925081433223, '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': '6478556', 'n_tokens_mistral': 512, 'n_tokens_neox': 482, 'n_words': 102}