<commit_before>(function() {
  'use strict';

  function GamesController($scope, GamesFactory) {
    var vm = this;

    vm.checkedPlatforms = [];

    $scope.init = function(){
      $('.ui.selection.dropdown').dropdown();
    }
    $scope.init()

    // Callable methods on the vm:
    vm.createGame = createGame;
    vm.updateGame = updateGame;
    vm.deleteGame = deleteGame;
    vm.addPlatform = addPlatform;

    // Instantiated info:
    activate();

    // Defined methods:
    function activate() {
      getGames()
      getPublishers()
      getGenres()
      getPlatforms()
    }

    function getGames() {
      return GamesFactory.getGames()
                        .then(setGames)
    }

    function getPublishers() {
      return GamesFactory.getPublishers()
                        .then(setPublishers)
    }

    function getGenres() {
      return GamesFactory.getGenres()
                        .then(setGenres)
    }

    function getPlatforms() {
      return GamesFactory.getPlatforms()
                        .then(setPlatforms)
    }

    function createGame() {
      vm.game.platform_ids = [];
      vm.checkedPlatforms.forEach(function(platform_id) {
        vm.game.platform_ids.push(platform_id)
      })
      return GamesFactory.createGame(vm.game)
                        .then(addGame)
    }

    function updateGame() {
      
    }

    function deleteGame() {
      
    }

    function addPlatform(platform_id) {
      return vm.checkedPlatforms.push(platform_id);
      // return vm.games.platform_ids.push(platform_id);
    }

    function addGame(data) {
      console.log(data);
      return vm.games.push(data);
    }
    
    function setGames(data) {
      return vm.games = data;
    }

    function setPublishers(data) {
      return vm.publishers = data;
    }

    function setGenres(data) {
      return vm.genres = data;
    }

    function setPlatforms(data) {
      return vm.platforms = data;
    }

  }

  angular
    .module('app')
    .controller('GamesController', GamesController)
    
}());<commit_msg>remove unnecessary comments<commit_after>(function() {
  'use strict';

  function GamesController($scope, GamesFactory) {
    var vm = this;

    vm.checkedPlatforms = [];

    $scope.init = function(){
      $('.ui.selection.dropdown').dropdown();
    }
    $scope.init()

    // Callable methods on the vm:
    vm.createGame = createGame;
    vm.updateGame = updateGame;
    vm.deleteGame = deleteGame;
    vm.addPlatform = addPlatform;

    // Instantiated info:
    activate();

    // Defined methods:
    function activate() {
      getGames()
      getPublishers()
      getGenres()
      getPlatforms()
    }

    function getGames() {
      return GamesFactory.getGames()
                        .then(setGames)
    }

    function getPublishers() {
      return GamesFactory.getPublishers()
                        .then(setPublishers)
    }

    function getGenres() {
      return GamesFactory.getGenres()
                        .then(setGenres)
    }

    function getPlatforms() {
      return GamesFactory.getPlatforms()
                        .then(setPlatforms)
    }

    function createGame() {
      vm.game.platform_ids = [];
      vm.checkedPlatforms.forEach(function(platform_id) {
        vm.game.platform_ids.push(platform_id)
      })
      return GamesFactory.createGame(vm.game)
                        .then(addGame)
    }

    function updateGame() {
      
    }

    function deleteGame() {
      
    }

    function addPlatform(platform_id) {
      return vm.checkedPlatforms.push(platform_id);
    }

    function addGame(data) {
      return vm.games.push(data);
    }
    
    function setGames(data) {
      return vm.games = data;
    }

    function setPublishers(data) {
      return vm.publishers = data;
    }

    function setGenres(data) {
      return vm.genres = data;
    }

    function setPlatforms(data) {
      return vm.platforms = data;
    }

  }

  angular
    .module('app')
    .controller('GamesController', GamesController)
    
}());
{'fraction_non_alphanumeric': 0.11225997045790251, 'fraction_numerical': 0.0, 'mean_word_length': 2.0029563932002956, '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': '3426979', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1176, 'n_words': 209}