<commit_before>import { A } from '@ember/array';
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

import { task } from 'ember-concurrency';

import ajax from '../utils/ajax';

const TO_SHOW = 5;

export default class DashboardController extends Controller {
  hasMore = false;
  myFeed = A();

  @alias('model.myCrates') myCrates;
  @alias('model.myFollowing') myFollowing;
  @alias('model.myStats') myStats;

  @computed('myCrates.[]')
  get visibleCrates() {
    return this.myCrates.slice(0, TO_SHOW);
  }

  @computed('myFollowing.[]')
  get visibleFollowing() {
    return this.myFollowing.slice(0, TO_SHOW);
  }

  @computed('myCrates.[]')
  get hasMoreCrates() {
    return this.get('myCrates.length') > TO_SHOW;
  }

  @computed('myFollowing.[]')
  get hasMoreFollowing() {
    return this.get('myFollowing.length') > TO_SHOW;
  }

  @task(function* () {
    let page = this.myFeed.length / 10 + 1;

    let data = yield ajax(`/api/v1/me/updates?page=${page}`);
    let versions = data.versions.map(version => this.store.push(this.store.normalize('version', version)));

    this.myFeed.pushObjects(versions);
    this.set('hasMore', data.meta.more);
  })
  loadMoreTask;
}<commit_msg>dashboard: Remove unnecessary `this.get()` calls<commit_after>import { A } from '@ember/array';
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

import { task } from 'ember-concurrency';

import ajax from '../utils/ajax';

const TO_SHOW = 5;

export default class DashboardController extends Controller {
  hasMore = false;
  myFeed = A();

  @alias('model.myCrates') myCrates;
  @alias('model.myFollowing') myFollowing;
  @alias('model.myStats') myStats;

  @computed('myCrates.[]')
  get visibleCrates() {
    return this.myCrates.slice(0, TO_SHOW);
  }

  @computed('myFollowing.[]')
  get visibleFollowing() {
    return this.myFollowing.slice(0, TO_SHOW);
  }

  @computed('myCrates.[]')
  get hasMoreCrates() {
    return this.myCrates.length > TO_SHOW;
  }

  @computed('myFollowing.[]')
  get hasMoreFollowing() {
    return this.myFollowing.length > TO_SHOW;
  }

  @task(function* () {
    let page = this.myFeed.length / 10 + 1;

    let data = yield ajax(`/api/v1/me/updates?page=${page}`);
    let versions = data.versions.map(version => this.store.push(this.store.normalize('version', version)));

    this.myFeed.pushObjects(versions);
    this.set('hasMore', data.meta.more);
  })
  loadMoreTask;
}
{'fraction_non_alphanumeric': 0.16440480806514152, 'fraction_numerical': 0.005428460643660334, 'mean_word_length': 4.139442231075697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5367576', 'n_tokens_mistral': 909, 'n_tokens_neox': 865, 'n_words': 176}