<commit_before>var app=angular.module('login',[]);
app.controller('auth',function($scope){});
var app=angular.module('registration',[]);
app.controller('create',function($scope){
    $scope.validateForm=function(){
        var fullname=$.trim(document.accountform.user_name.value);
        if(fullname!=""){
            var email=$.trim(document.accountform.user_email.value);
            if(email!=""){
                var pass1=document.accountform.user_password.value;
                if(pass1.length>=8){
                    var pass2=document.accountform.user_password2.value;
                    if(pass2===pass1){
                        $(".btn-primary").addClass("disabled");
                        document.accountform.submit();
                    }
                    else{
                        messageBox("Password Mismatch","Please ensure that the password you repeat matches the first password.");    
                    }
                }
                else{
                    messageBox("Invalid Password","Please enter a valid password with at least 8 characters.");    
                }
            }
            else{
                messageBox("Invalid Email","Please enter a valid email ID.");    
            }
        }
        else{
            messageBox("Invalid Name","Please enter a valid full name.");
        }
    };
});
var app=angular.module('applications',[]);
app.controller('apps',function($scope,$http,$compile){
    $scope.applicationArray=[];
    $scope.application_id=null;
    $scope.appCount=0;
    $scope.getApplications=function(){
        $http({
            method: 'GET',
            url: 'getApplications'
        }).then(function success(response){
            if(typeof response=='object'){
                response=response.data;
                $scope.applicationArray=response.slice();
                $scope.displayApplications();
            }
            else{
                response=$.trim(response);
                if((response!="")&&(response!="INVALID_PARAMETERS")){
                    if(response=="INVALID_USER_ID"){
                        window.location='logout';
                    }
                    else if(response=="NO_APPLICATIONS_FOUND"){
                        var p=document.createElement("p");
                        $(p).html("No applications found.");
                        $("#appHolder").html(p);
                    }
                    else{
                        messageBox("Problem","Something went wrong while loading your list of applications. This is the error we see: "+response);    
                    }
                }
                else{
                    messageBox("Problem","Something went wrong while loading your list of applications.");
                }
            }
        }, function error(response){
            messageBox("Problem","Something went wrong while loading your list of applications. Please try again later. This is the error we see: "+response);
        });
    }; 
    $scope.displayApplications=function(){
        var applications=$scope.applicationArray.slice();
        if(applications.length>0){
            var count=applications.length;
            $("#appCount").html(count);
            $("#appHolder").html("<hr>");
            var table=document.createElement("table");
            $(table).addClass("table");
                var thead=document.createElement("thead");
                    var tr1=document.createElement("tr");
                        var th1=document.createElement("th");
                        $(th1).html("Title");
                    $(tr1).append(th1);
                        var th2=document.createElement("th");
                        $(th2).html("Description");
                    $(tr1).append(th2);
                        var th3=document.createElement("th");
                        $(th3).html("Status");
                    $(tr1).append(th3);
                        var th4=document.createElement("th");
                        $(th4).html("Actions");
                    $(tr1).append(th4);
                $(thead).append(tr1);
            $(table).append(thead);
                var tbody=document.createElement("tbody");
            for(var i=0;i<applications.length;i++){
                var application=applications[i];
                var appID=application.idapplication_master;
                var appTitle=application.application_title;
                var appDesc=application.application_description;
                var stat=application.stat;
                if(stat==1){    
                    stat='Live';
                }
                else if(stat==2){
                    stat='Incomplete';
                }
                else{
                    stat='Deleted';
                }
                var tr=document.createElement("tr");
                    var td1=document.createElement("td");
                        var a=document.createElement("a");
                        $(a).attr("href","#");
                        $(a).html(appTitle);
                        $(a).attr("title","Open application");
                        $(a).attr("data-toggle","tooltip");
                        $(a).attr("data-placement","auto");
                    $(td1).html(a);   
                $(tr).append(td1);
                    var td2=document.createElement("td");
                    $(td2).html(appDesc);
                $(tr).append(td2);
                    var td3=document.createElement("td");
                    $(td3).html(stat);
                $(tr).append(td3);
                    var td4=document.createElement("td");
                        var button=document.createElement("button");
                        $(button).addClass("btn btn-info btn-xs");
                        $(button).attr("type","button");
                        $(button).html("Make live");
                    $(td4).html(button);
                $(tr).append(td4);
                $(tbody).append(tr);
            }
            $(table).append(tbody);
            $("#appHolder").append(table);
            $compile("#appHolder")($scope);
            /*$('[data-toggle]="tooltip').tooltip({
                trigger: hover
            });*/
        }
        else{
            var p=document.createElement("p");
            $(p).html("No applications found.");
            $("#appHolder").html(p);
        }
    };
    $scope.createApplicationForm=function(){
        var form=document.createElement("form");
        $(form).attr("autocomplete","off");
        $(form).attr("name","createapp");
            var appTitleGroup=document.createElement("div");
            $(appTitleGroup).addClass("form-group");
            $(appTitleGroup).attr("id","apptitlegroup");
                var appTitleLabel=document.createElement("label");
                $(appTitleLabel).attr("for","apptitle");
                $(appTitleLabel).html("Application title");
                $(appTitleGroup).append(appTitleLabel);
                var appTitle=document.createElement("input");
                $(appTitle).attr("type","text");<commit_msg>Field additions<commit_after>var app=angular.module('login',[]);
app.controller('auth',function($scope){});
var app=angular.module('registration',[]);
app.controller('create',function($scope){
    $scope.validateForm=function(){
        var fullname=$.trim(document.accountform.user_name.value);
        if(fullname!=""){
            var email=$.trim(document.accountform.user_email.value);
            if(email!=""){
                var pass1=document.accountform.user_password.value;
                if(pass1.length>=8){
                    var pass2=document.accountform.user_password2.value;
                    if(pass2===pass1){
                        $(".btn-primary").addClass("disabled");
                        document.accountform.submit();
                    }
                    else{
                        messageBox("Password Mismatch","Please ensure that the password you repeat matches the first password.");    
                    }
                }
                else{
                    messageBox("Invalid Password","Please enter a valid password with at least 8 characters.");    
                }
            }
            else{
                messageBox("Invalid Email","Please enter a valid email ID.");    
            }
        }
        else{
            messageBox("Invalid Name","Please enter a valid full name.");
        }
    };
});
var app=angular.module('applications',[]);
app.controller('apps',function($scope,$http,$compile){
    $scope.applicationArray=[];
    $scope.application_id=null;
    $scope.appCount=0;
    $scope.getApplications=function(){
        $http({
            method: 'GET',
            url: 'getApplications'
        }).then(function success(response){
            if(typeof response=='object'){
                response=response.data;
                $scope.applicationArray=response.slice();
                $scope.displayApplications();
            }
            else{
                response=$.trim(response);
                if((response!="")&&(response!="INVALID_PARAMETERS")){
                    if(response=="INVALID_USER_ID"){
                        window.location='logout';
                    }
                    else if(response=="NO_APPLICATIONS_FOUND"){
                        var p=document.createElement("p");
                        $(p).html("No applications found.");
                        $("#appHolder").html(p);
                    }
                    else{
                        messageBox("Problem","Something went wrong while loading your list of applications. This is the error we see: "+response);    
                    }
                }
                else{
                    messageBox("Problem","Something went wrong while loading your list of applications.");
                }
            }
        }, function error(response){
            messageBox("Problem","Something went wrong while loading your list of applications. Please try again later. This is the error we see: "+response);
        });
    }; 
    $scope.displayApplications=function(){
        var applications=$scope.applicationArray.slice();
        if(applications.length>0){
            var count=applications.length;
            $("#appCount").html(count);
            var table=document.createElement("table");
            $(table).addClass("table");
                var thead=document.createElement("thead");
                    var tr1=document.createElement("tr");
                        var th1=document.createElement("th");
                        $(th1).html("Title");
                    $(tr1).append(th1);
                        var th2=document.createElement("th");
                        $(th2).html("Description");
                    $(tr1).append(th2);
                        var th3=document.createElement("th");
                        $(th3).html("Status");
                    $(tr1).append(th3);
                        var th4=document.createElement("th");
                        $(th4).html("Actions");
                    $(tr1).append(th4);
                $(thead).append(tr1);
            $(table).append(thead);
                var tbody=document.createElement("tbody");
            for(var i=0;i<applications.length;i++){
                var application=applications[i];
                var appID=application.idapplication_master;
                var appTitle=application.application_title;
                var appDesc=application.application_description;
                var stat=application.stat;
                if(stat==1){    
                    stat='Live';
                }
                else if(stat==2){
                    stat='Incomplete';
                }
                else{
                    stat='Deleted';
                }
                var tr=document.createElement("tr");
                    var td1=document.createElement("td");
                        var a=document.createElement("a");
                        $(a).attr("href","#");
                        $(a).html(appTitle);
                        $(a).attr("title","Open application");
                        $(a).attr("data-toggle","tooltip");
                        $(a).attr("data-placement","auto");
                    $(td1).html(a);   
                $(tr).append(td1);
                    var td2=document.createElement("td");
                    $(td2).html(appDesc);
                $(tr).append(td2);
                    var td3=document.createElement("td");
                    $(td3).html(stat);
                $(tr).append(td3);
                    var td4=document.createElement("td");
                        var button=document.createElement("button");
                        $(button).addClass("btn btn-info btn-xs");
                        $(button).attr("type","button");
                        $(button).html("Make live");
                    $(td4).html(button);
                $(tr).append(td4);
                $(tbody).append(tr);
            }
            $(table).append(tbody);
            $("#appHolder").html(table);
            $compile("#appHolder")($scope);
            /*$('[data-toggle]="tooltip').tooltip({
                trigger: hover
            });*/
        }
        else{
            var p=document.createElement("p");
            $(p).html("No applications found.");
            $("#appHolder").html(p);
        }
    };
    $scope.createApplicationForm=function(){
        var form=document.createElement("form");
        $(form).attr("autocomplete","off");
        $(form).attr("name","createapp");
            var appTitleGroup=document.createElement("div");
            $(appTitleGroup).addClass("form-group");
            $(appTitleGroup).attr("id","apptitlegroup");
                var appTitleLabel=document.createElement("label");
                $(appTitleLabel).attr("for","apptitle");
                $(appTitleLabel).html("Application title");
                $(appTitleGroup).append(appTitleLabel);
                var appTitle=document.createElement("input");
                $(appTitle).attr("type","text");
{'fraction_non_alphanumeric': 0.1425959780621572, 'fraction_numerical': 0.0060469694838981855, 'mean_word_length': 1.4856693463823838, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '2039883', 'n_tokens_mistral': 3434, 'n_tokens_neox': 3209, 'n_words': 525}