1. Лучший говнокод

    В номинации:
    За время:
  2. PHP / Говнокод #12885

    +148

    1. 1
    2. 2
    3. 3
    if (!$_FILES['image']['size'] > 0) {
    		return;
    	}

    и что самое интересное - оно делает то, что автор пытался изобразить!

    paulrudy, 12 Апреля 2013

    Комментарии (5)
  3. PHP / Говнокод #12710

    +148

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    function index_tools_transport_http_get($rm = '0') {
    	static $ra		=	NULL;
    	#
    	if (!isset($ra)) {
    		$qa			=	explode('/', preg_replace('#(\/)+#', '/', $_SERVER['QUERY_STRING']), 21);
    		$ra			=	array_chunk($qa, 5);
    	}
    	#
    	if ($rm == 'full') {
    		return $ra;
    	} else {
    		return $ra[$rm];
    	}
    }

    Здравствуйте товарищи! Эта функция разбирает URL типа ?param1/param2/param3 и создаст массив с разделением на группы по 5 параметров в группе, увидел у одного программиста в коде, достоин ли этот код находиться здесь?

    htaccess, 09 Марта 2013

    Комментарии (0)
  4. JavaScript / Говнокод #12639

    +148

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if(diap=='0'){sucs=adder(rooms_0, ident, this);}
    if(diap=='1'){sucs=adder(rooms_1, ident, this);}
    if(diap=='2'){sucs=adder(rooms_2, ident, this);}
    if(diap=='3'){sucs=adder(rooms_3, ident, this);}
    if(diap=='4'){sucs=adder(rooms_4, ident, this);}

    DRY? Не, не слышал..

    dizballanze, 23 Февраля 2013

    Комментарии (0)
  5. JavaScript / Говнокод #12538

    +148

    1. 1
    document.getElementById('siF20').disabled=(this.checked==true)?false:true;

    kasthack, 05 Февраля 2013

    Комментарии (4)
  6. JavaScript / Говнокод #12367

    +148

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function mouseHover(state) {
    	var row = window.event.srcElement;
    	row.style.cursor='hand';
    	var colorChange = ((state == "over") ? "#ff0000" : "");
    	row.style.color = colorChange;
    	var textChange  = ((state == "over") ? "underline" : "none");
    	row.style.textDecoration = textChange;
    }
    
    Где-то в Html
    
    <DIV onmouseover="mouseHover('over')" onmouseout="mouseHover('out')">

    Из странички отчёта Microsoft SCCM

    dens, 27 Декабря 2012

    Комментарии (4)
  7. JavaScript / Говнокод #12345

    +148

    1. 1
    $("#ORDER_PROP_5 option[value='7361']").attr("selected", "selected");

    Установка значения в селекте.

    torch1313, 24 Декабря 2012

    Комментарии (12)
  8. JavaScript / Говнокод #11526

    +148

    1. 1
    2. 2
    3. 3
    4. 4
    $("#select_id :selected").attr("selected", false);
    $("#select_id option[value='" + new_value + "']").attr("selected", true);
    вместо
    $("#select_id").val(new_value);

    splinter89, 03 Августа 2012

    Комментарии (4)
  9. JavaScript / Говнокод #10630

    +148

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    var isScheduledRadio = $('#ContentPlaceHolder1_FormView1_ctl04_ctl00___IsScheduled_RadioButtonList1_0')[0],
                    isSitnGoRadio = $('#ContentPlaceHolder1_FormView1_ctl04_ctl00___IsScheduled_RadioButtonList1_1')[0],
                    startDateTextBox = $('#ContentPlaceHolder1_FormView1_ctl04_ctl07___StartDate_TextBox1')[0],
                    minPlayersTextBox = $('#ContentPlaceHolder1_FormView1_ctl04_ctl14___MinPlayers_TextBox1')[0],
                    maxPlayersTextBox = $('#ContentPlaceHolder1_FormView1_ctl04_ctl15___MaxPlayers_TextBox1')[0],
                    maxPlayersRequiredValidator = $('#ContentPlaceHolder1_FormView1_ctl04_ctl15___MaxPlayers_RequiredFieldValidator1')[0],
                    maxPlayersRow = $('#ContentPlaceHolder1_FormView1_ctl04_ctl15___MaxPlayers_TextBox1')
                        .parent()
                        .parent()[0],
                    endDateTextBox = $('#ContentPlaceHolder1_FormView1_ctl04_ctl08___EndDate_TextBox1')[0],
                    endDateRequiredValidator = $('#ContentPlaceHolder1_FormView1_ctl04_ctl08___EndDate_RequiredFieldValidator1')[0],
                    endDateRow = $('#ContentPlaceHolder1_FormView1_ctl04_ctl08___EndDate_TextBox1')
                        .parent()
                        .parent()[0],

    Увидел такой код с сорцах ASP.Net страницы

    krikz, 08 Июня 2012

    Комментарии (7)
  10. JavaScript / Говнокод #10564

    +148

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    ISQ.Translation.Infra.extractJobIdFromText=function(k){
        var d;
        var g=k.toLowerCase();
        var j=g.indexOf("<"+ISQ.Translation.Infra.jobIdMarkerTag);
        if(j===-1){
    	j=g.indexOf("< "+ISQ.Translation.Infra.jobIdMarkerTag)
        }
        if(j===-1){
    	if(ISQ.Widget&&ISQ.Widget.Log){
    	    ISQ.Widget.Log.add("ISQ.Translation.Infra.extractJobIdFromText: Couldnt parse jobIdMarker from text! "+k,ISQ.Widget.Log.statusEnum.RED)
    	}
    	return{id:-1,text:k}
        }
        var b=k.indexOf(">",j);
        if(b===-1){
    	if(ISQ.Widget&&ISQ.Widget.Log){
    	    ISQ.Widget.Log.add("ISQ.Translation.Infra.extractJobIdFromText: jobIdMarker tag is invalid!",ISQ.Widget.Log.statusEnum.RED)
    	}
    	return{id:-1,text:k}
    
        }
        b+=1;
        var h=g.substring(j,b);
        var e=h.indexOf(ISQ.Translation.Infra.jobIdMarkerTag);
        if(e===-1){
    	if(ISQ.Widget&&ISQ.Widget.Log){
    	    ISQ.Widget.Log.add("ISQ.Translation.Infra.extractJobIdFromText: jobIdMarker tag is invalid!",ISQ.Widget.Log.statusEnum.RED)
    	}
    	return{id:-1,text:k}
        }
        e+=ISQ.Translation.Infra.jobIdMarkerTag.length;
        var f="";
        var a;
        do
        {
    	if(e>h.length){
    	    break
    	}
    	a=h.charAt(e++);
    	if(a.charCodeAt(0)<48||a.charCodeAt(0)>57){
    	    break
    	}
    	f+=a
        }
        while(true);
        d=parseInt(f);
        if(isNaN(d)){
    	if(ISQ.Widget&&ISQ.Widget.Log){
    	    ISQ.Widget.Log.add(
    		"ISQ.Translation.Infra.extractJobIdFromText: jobIdMarker tag is invalid: could not parse id#",
    		ISQ.Widget.Log.statusEnum.RED)
    	}
    	return{id:-1,text:k}
        }
        var i;
        if(j===0){
    	i=k.substring(b)
        }
        else
        {
    	i=k.substring(0,j);
    	if(b<k.length){
    	    i+=k.substring(b)
    	}
        }
        return{id:d,text:i}
    };

    Закомммммммммммментировал!

    wvxvw, 04 Июня 2012

    Комментарии (16)
  11. JavaScript / Говнокод #10362

    +148

    1. 1
    if(type_file=='png'||type_file=='jpg'||type_file=='gif'||type_file=='jpeg'||type_file=='png')

    хуита, 24 Мая 2012

    Комментарии (33)