Mistři v programování na #hovnokod

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,

a dalo se to napsat zloziteji?

(actions.includes("EDIT_ACTION") || actions.includes("SHOW_ACTION") || actions.includes('CREATE_ACTION')) ? this.showComponent = true : '';
(actions.includes("EDIT_ACTION") || actions.includes('CREATE_ACTION')) ? this.showButtonSave = true : '';
actions.includes("SAVE_ACTION") ? this.allowSave = true : '';

if(actions.includes("EDIT_ACTION") || actions.includes("SHOW_ACTION") || actions.includes('CREATE_ACTION') || actions.includes("SAVE_ACTION")) {
	this.showTab = true;
} else {
	this.showTab = false;
}

Anonymous,


Anonymous,

V JS je vsetko mozne...utrzok kodu z code review :D

switch (true) {
  case windowWidth > 840 && windowWidth < 950:
    return 1;
  case windowWidth < 400:
    return2;
  default:
    return 3;
}

Anonymous,

...alebo ako zakomentovat javascript

/* <!-- reklamy AdSense -->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: "ca-pub-XXXXXXXXXXXXX",
          enable_page_level_ads: true
     });
</script> */

Anonymous,