Mistři v programování na #hovnokod

JavaScript #4698

Kolegové "vývojáři" z Indie... A takhle je psaný celý projekt. Špagety kam se podíváš, divím se, že to vůbec funguje ...

if(formdata.attachType.toUpperCase()=='BROWSE'){
                                //Change the Post API Url if upload file extension is Zip while creating the Resource
                                if(formdata.resource && formdata.resource.name) {
                                var fileExt1 = formdata.resource.name.split('.')[formdata.resource.name.split('.').length -1];
                                if(fileExt1.toUpperCase() == 'ZIP' && (formdata.type.toUpperCase()=='R' || formdata.type.toUpperCase()=='PYTHON')){
                                    createResourceUrl = 'admin/res/createForZip';
                                    }
                                }
                                    // Change the post API url if file extension is zip while CLONING a resource
                                if(formdata.resource && formdata.resource.resourceName) {
                                    var fileExt2 = formdata.resource.resourceName.split('.')[formdata.resource.resourceName.split('.').length -1];
                                    if(fileExt2.toUpperCase() == 'ZIP' && (formdata.type.toUpperCase()=='R' || formdata.type.toUpperCase()=='PYTHON')){
                                    createResourceUrl = 'admin/res/createForZip';
                                    }
                                }
                            }

Anonymous,