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

    angular
      .module('password.profile')
      .controller('ProfileController', ProfileController);

    function ProfileController(userService, dataService, $route,
                               dialogService, config) {
        var vm = this;

        vm.user = null;
        vm.method = {
            'emails': [],
            'phones': []
        };
        vm.config = config;

        vm.delete = remove;
        
        activate();

        //////////////////////////////////////////////////////////////////

        function activate() {
            userService
              .getUser(true)
              .then(function (user) {
                  vm.user = user;
              });

            dataService
              .get('method')
              .then(extractMethods)
              .finally(dialogService.close());

            // dialogService.progress();
        }

        function extractMethods(response) {

            dialogService.progress();

            var allMethods = response.data;

            dialogService.close();

            checkForMethods(allMethods);

            allMethods
              .forEach(function (method) {
                  switch (method.type) {
                      case 'email': vm.method.emails.push(method); break;
                      case 'phone': vm.method.phones.push(method);
                  }
              });

            dialogService.close();
        }

        function checkForMethods(methods) {
            if (methods.filter(excludePrimary).length === 0) {
                dialogService.noMethods();
            }
        }

        function excludePrimary(method) {
            return method.type !== 'primary';<commit_msg>move where close progress modal in code<commit_after>(function () {
    'use strict';

    angular
      .module('password.profile')
      .controller('ProfileController', ProfileController);

    function ProfileController(userService, dataService, $route,
                               dialogService, config) {
        var vm = this;

        vm.user = null;
        vm.method = {
            'emails': [],
            'phones': []
        };
        vm.config = config;

        vm.delete = remove;
        
        activate();

        //////////////////////////////////////////////////////////////////

        function activate() {
            userService
              .getUser(true)
              .then(function (user) {
                  vm.user = user;
              });

            dataService
              .get('method')
              .then(extractMethods)
              .finally(dialogService.close());

            // dialogService.progress();
        }

        function extractMethods(response) {

            dialogService.progress();
            dialogService.close();

            var allMethods = response.data;

            checkForMethods(allMethods);

            allMethods
              .forEach(function (method) {
                  switch (method.type) {
                      case 'email': vm.method.emails.push(method); break;
                      case 'phone': vm.method.phones.push(method);
                  }
              });

            dialogService.close();
        }

        function checkForMethods(methods) {
            if (methods.filter(excludePrimary).length === 0) {
                dialogService.noMethods();
            }
        }

        function excludePrimary(method) {
            return method.type !== 'primary';
{'fraction_non_alphanumeric': 0.14143709173530247, 'fraction_numerical': 0.0005680204487361545, 'mean_word_length': 1.20125, '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': '1987087', 'n_tokens_mistral': 820, 'n_tokens_neox': 770, 'n_words': 147}