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

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

    +160

    1. 1
    2. 2
    3. 3
    if(floor($info['http_code'] / 100) >= 4) {
      throw $this->castError($result);
    }

    Библиотека интеграции с Mandrill.

    korchasa, 20 Ноября 2013

    Комментарии (4)
  3. C# / Говнокод #14086

    +131

    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
    try
                {
                    m = (int)Convert.ToInt32(num[1]);
                }
                catch
                {
                    Console.WriteLine("Invalid parametr");
                    return true;
                }
    
    //...................................................
                  try
                        {
                            matrix[i, j] = (float)Convert.ToDouble(num[j]);
                            
                        }
                        catch
                        {
                            Console.WriteLine("Invalid matrix");
                            return false;
                        }

    Лаба одногруника...

    Michigan, 09 Ноября 2013

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

    +161

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    this.ShowHideNoticeDate = function () {
            if ($("#associateNotice").is(':checked')) {
                jsNoticeField.setFieldValue(1);            
                $("#associateNotice").parent().parent().parent().parent().parent().parent().next().show();
                $("#associateNotice").parent().parent().parent().parent().parent().parent().next().children(1).children(0).children(0).children(0).children(0).children(0).children(1).val("");
                
            } else {
                jsNoticeField.setFieldValue(0);
                $("#associateNotice").parent().parent().parent().parent().parent().parent().next().hide();            
                $("#associateNotice").parent().parent().parent().parent().parent().parent().next().children(1).children(0).children(0).children(0).children(0).children(0).children(1).val("");            
            }
        };

    Голландский джаваскриптик)))

    RomashkaPro, 08 Ноября 2013

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

    +151

    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
    function recalcMeal() {
                jQuery('.recalc2').bind("click", function () {
                    pusto = '';
                    jQuery.each(jQuery('.vuborka input'), function (index) {
                        var allInputValueMeal = parseInt(jQuery(this).val());
                        if (allInputValueMeal != 0 && $.browser.msie) {
                            for (var i = 0; i < allInputValueMeal; i++) {
                                pusto = pusto + jQuery(this).parent().parent().parent().next().find('.boxtypecode').val() + ';';
                            }
                        }
                        else if (allInputValueMeal != 0 && !($.browser.msie)) {
                            for (var i = 0; i < allInputValueMeal; i++) {
                                pusto = pusto + jQuery(this).parent().parent().parent().next().val() + ';';
                            }
                        }
                    });
    
                    jQuery('.selectedcabins').val(pusto);
                });
            }

    Код который я поддерживаю от старого работника.

    sladkijBubaleh, 16 Октября 2013

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

    +141

    1. 1
    2. 2
    3. 3
    4. 4
    Мартышка и слон решили укоротить удава. Слон говорит "А давайте ему ебало отрежем"
    -Мартышка: нет, без ебала он не выживет, нужно хвост отрезать, но докуда?
    Слон: до ебала
    АХАХАХАХАХАХАХА

    Не говнокод, просто забавно

    PragramistOtBoga, 12 Октября 2013

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

    +149

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public function fetchEmployees()
        {
            global $result, $check_u_id, $second_check_u_id, $query123;
    
            ....

    __proto__, 30 Сентября 2013

    Комментарии (4)
  8. C# / Говнокод #13863

    +129

    1. 1
    2. 2
    var tiffFileName = GetRandomNameForTiffFile() +
    	currentObject.FileName.Substring(currentObject.FileName.LastIndexOf(".", StringComparison.Ordinal) > 0 ? currentObject.FileName.LastIndexOf(".", StringComparison.Ordinal) : 0);

    Это наверное тоже бояный пример говнокода, но всё же меня порадовал

    Smekalisty, 27 Сентября 2013

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

    +153

    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
    $("#ChildrenCount")
                .keyup(function () {
                    var $this = $(this);
    
                    if ($this.val() > maxChild) {
                        $this.val(maxChild);
                    }
                })
                .blur(function () {
                    var $this = $(this);
    
                    if ($this.val().toString().match(/^\d+$/) == null) {
                        for (var i = 0; i < viewModel.children().length; i++) {
                            viewModel.children.remove(i);
                        }
                        $this.val(0);
                    }
                    else if ($this.val() === NaN) {
                        for (var i = 0; i < viewModel.children().length; i++) {
                            viewModel.children.remove(i);
                        }
                        $this.val(0);
                    }
                });

    когда джуниор использует jquery в проекте с knockout

    sladkijBubaleh, 20 Сентября 2013

    Комментарии (4)
  10. PHP / Говнокод #13806

    +141

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    class test {
            var $пиздец = 'это он';
     
    function вывод() {
     echo $this->пиздец;
    }
     
    }
     
    $a = new test();
    $a->вывод();

    http://www.skillz.ru/dev/php/article-first_c_otkake.html

    Stealth, 17 Сентября 2013

    Комментарии (4)
  11. PHP / Говнокод #13801

    +153

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $imgs = glob('images/'.$url_parts[0].'/*');
        
        // Windows detection
        if(DIRECTORY_SEPARATOR == '\\') {
            $cnt = count($imgs);
            for($i = 0; $i < $cnt; $i++) $imgs[$i] = iconv('CP1251//IGNORE', 'UTF-8', $imgs[$i]);
        }

    DIX315, 17 Сентября 2013

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