<commit_before>import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';


export default Component.extend({
  tagName: 'div',
  classNames: [ 'license' ],
  citations: 0,
  views: 0,
  downloads: 0,
  label: '',
  metrics: [],
  store: service(),
  hasUsage: computed('views','downloads', function() {
    return ((this.views + this.downloads) > 0) ?  true  : false;
  }),
  hasMetrics: computed('citations','views','downloads', function() {
    return ((this.views + this.downloads + this.citations) > 0) ?  true  : false;
  }),

  init() {
    this._super();
  },

  didReceiveAttrs() {
    this._super(...arguments);

    this.passMetrics();
  },
  passMetrics() {
    let self = this;
    self.set('citations' , this.model.citations);
    self.set('views',this.model.views);
    self.set('downloads',this.model.downloads);
  },<commit_msg>deal with undefined<commit_after>import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';


export default Component.extend({
  tagName: 'div',
  classNames: [ 'license' ],
  citations: 0,
  views: 0,
  downloads: 0,
  label: '',
  store: service(),
  hasUsage: computed('views','downloads', function() {
    return ((this.views + this.downloads) > 0) ?  true  : false;
  }),
  hasMetrics: computed('views','downloads','citations',function() {
    return ((this.views + this.downloads + this.citations) > 0) ?  true  : false;
  }),

  init() {
    this._super();
  },

  didReceiveAttrs() {
    this._super(...arguments);

    this.passMetrics();
  },
  passMetrics() {
    let self = this;
    self.set('citations' , this.model.citations || 0);
    self.set('views', this.model.views || 0);
    self.set('downloads',this.model.downloads || 0);
  },
{'fraction_non_alphanumeric': 0.18162162162162163, 'fraction_numerical': 0.007027027027027027, 'mean_word_length': 3.6624685138539044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3849843', 'n_tokens_mistral': 620, 'n_tokens_neox': 585, 'n_words': 130}