<commit_before>(function(){
    'use strict';
    
    angular
        .module('starter')
        .controller('ManipulateController', ManipulateController);
    
    ManipulateController.$inject = ['$scope', '$log', 'erc', 'httpRequests'];
    function ManipulateController($scope, $log, erc, httpRequests){
        var manipulate = erc.metadata.o2r.interaction;
        var vm = this;
        vm.selectedTab = 0;
        vm.threshold = null;
        vm.query = "";

        vm.manipulations = [];
        manipulate.forEach(element => {
            vm.manipulations.push(element);
        });

        vm.activateCodeData = () => $scope.$parent.vm.activateMCodeData();
        $log.debug(manipulate);

        $scope.$on('$destroy', function(){
            $scope.$parent.vm.resetMCodeData();
        });

        $scope.$watch('vm.selectedTab', function(newValue, oldVal){
            buildManipulationView(newValue);
            $log.debug('Tab changed to object: %s', newValue);

            vm.query = createUrl(vm.manipulations[newValue].port, vm.manipulations[newValue].result.value, vm.manipulations[newValue].code.parameter.val);
            $scope.$watch('vm.threshold', function(newVal, oldVal){
                if (newVal !=null){
                    vm.query = createUrl(vm.manipulations[newValue].port, vm.manipulations[newValue].result.value, newVal);
                    console.log("query sent " + vm.query)
                }
            });
        });

        function createUrl(port, result, value){
            if (typeof value == 'string'){
                //value = value.substring(1, value.length-1);<commit_msg>manipulation controller<commit_after>(function(){
    'use strict';
    angular
        .module('starter')
        .controller('ManipulateController', ManipulateController);
    ManipulateController.$inject = ['$scope', '$log', 'erc', 'httpRequests'];
    function ManipulateController($scope, $log, erc, httpRequests){
        var manipulate = erc.metadata.o2r.interaction;
        var vm = this;
        vm.threshold = null;
        vm.selectedTab = 0;
        vm.query = "";

        vm.manipulations = [];
        manipulate.forEach(element => {
            vm.manipulations.push(element);
        });

        vm.activateCodeData = () => $scope.$parent.vm.activateMCodeData();
        $log.debug(manipulate);

        $scope.$on('$destroy', function(){
            $scope.$parent.vm.resetMCodeData();
        });

        $scope.$watch('vm.selectedTab', function(newValue, oldVal){
            buildManipulationView(newValue);
            $log.debug('Tab changed to object: %s', newValue);

            vm.query = createUrl(vm.manipulations[newValue].port, vm.manipulations[newValue].result.value, vm.manipulations[newValue].code.parameter.val);
            $scope.$watch('vm.threshold', function(newVal, oldVal){
                if (newVal !=null){
                    vm.query = createUrl(vm.manipulations[newValue].port, vm.manipulations[newValue].result.value, newVal);
                    console.log("query sent " + vm.query)
                }
            });
        });

        function createUrl(port, result, value){
            if (typeof value == 'string'){
                //value = value.substring(1, value.length-1);
{'fraction_non_alphanumeric': 0.14783139890042762, 'fraction_numerical': 0.002443494196701283, 'mean_word_length': 2.2947686116700203, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6809641', 'n_tokens_mistral': 938, 'n_tokens_neox': 915, 'n_words': 150}