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

    В номинации:
    За время:
  2. Куча / Говнокод #8598

    +146

    1. 1
    http://rondo-pizza.kiev.ua/menu-order 14к с чертом строк говна

    по ссылке 14к с чертом строк говна в исходниках страницы

    ageron, 22 Ноября 2011

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

    +80

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    if((remoteMachineName == null || remoteMachineName == "")){
          result = new Result(false,"Invalid Remote Machine Name..!!");     
        }else{
         CheckOrTerminateProcInstanceTask task = new CheckOrTerminateProcInstanceTask
         (processName, argList, oper,  username, password,remoteMachineName,chkTer,chkTerMatch);
         if (remoteMachineName != null && remoteMachineName.length() > 0) {
         ....
         }else{
         ....
         }
        }

    Суровые индийские проверки

    Desperate, 20 Ноября 2011

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

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    function to_int_convert($num)
    {
        $arr_num = str_split($num);
        $new_num = "";
        foreach($arr_num as $key => $value)
                if($value == intval($value))
                $new_num = $new_num.$value;
        return $new_num;
    }

    korchasa, 18 Ноября 2011

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

    +162

    1. 1
    2. 2
    $id = $this->db->fetchCol('SELECT id FROM data;');
    $names = $this->db->fetchCol('SELECT name FROM points INNER JOIN data ON points.id = data.point_id_from;');

    Zend Db usage

    jf4ever, 18 Ноября 2011

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

    +157

    1. 1
    $newUrl = $newUrl = implode("?", array_merge($arUrl, array(implode("&", $pgAddUrl))));

    Вот так некоторые люди формируют URL.

    alexxxnf, 17 Ноября 2011

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

    +152

    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
    public static function fetchData($query)
    	{
    		$data = array();
    		for($i = 0; $i < mysql_num_rows($query);$i++)
    		{
    			$data[] = mysql_fetch_assoc($query);
    		}
    		return $data;
    	//	while($temp = mysql_fetch_assoc($query)){
    	//		$data[] = $temp;
    	//	}
    	//	return $data;
    	}

    Elenberg, 15 Ноября 2011

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

    +162

    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
    $er = array();
    
    $file1=$config['tpl_dir'].$config['general']['site_template'].'/style/catalog.css';
    $file2=$config['tpl_dir'].$config['general']['site_template'].'/module/catalog.html';
    $file3=$config['tpl_dir'].$config['general']['site_template'].'/module/catalog_read.html';
    $file4='modules/catalog/setup_catalog/table_catalog.MYD';
    $file5='modules/catalog/setup_catalog/table_catalog_cats.MYD';
    $file6='modules/catalog/setup_catalog/table_catalog_comments.MYD';
    $file7='modules/catalog/setup_catalog/table_catalog_rating.MYD';
    
    
    if(file_exists($file1)==True) {}else{$er[]="нет файла стилей <b>\"catalog.css\"</b> <br> он должен находиться в<b> $file1</b>"; }
    if(file_exists($file2)==True) {}else{$er[]="нет файла дизайна <b>\"catalog.html\"</b> <br> он должен находиться в<b> $file2</b>"; }
    if(file_exists($file3)==True) {}else{$er[]="нет файла дизайна <b>\"catalog_read.html\"</b> <br> он должен находиться в<b> $file3</b>"; }
    if(file_exists($file4)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog.MYD\"</b> <br> он должен находиться в<b> $file4</b>"; }
    if(file_exists($file5)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog_cats.MYD\"</b> <br> он должен находиться в<b> $file5</b>"; }
    if(file_exists($file6)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog_comments.MYD\"</b> <br> он должен находиться в<b> $file6</b>"; }
    if(file_exists($file7)==True) {}else{$er[]="нет файла таблицы <b>\"table_catalog_rating.MYD\"</b> <br> он должен находиться в<b> $file7</b>"; }

    Установщик модуля. Условия проверки доставляют: бул сравнимаем с булом (и получаем бул), вместо отрицания держим еще одну ветку условия.

    Мартин, 12 Ноября 2011

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

    +159

    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
    function get_selection()
    {
    	selection = "";
    	if (document.getSelection)
    	{
    		selection = document.getSelection();
    		selection = selection.replace(/\r\n\r\n/gi, "_doublecaret_");
    		selection = selection.replace(/\r\n/gi, " ");
    		while(selection.indexOf("  ") != -1)
    		selection = selection.replace(/  /gi, "");
    		selection = selection.replace(/_doublecaret_/gi, "\r\n\r\n");
    	}
    	else
    	if (document.selection) { selection = document.selection.createRange().text; }
    	return selection;
    }

    bugmenot, 11 Ноября 2011

    Комментарии (5)
  10. C# / Говнокод #8480

    +122

    1. 1
    2. 2
    if (!0.Equals(callResult.ValueOf("@retValue"))) // оба инт'ы
         ...

    Мы не ищем легких путей сравнения.

    fr0mrus, 11 Ноября 2011

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

    +156

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    //Redirect Using JAVASCRIPT 
         
        function redirect_to($url){ 
            echo '<script type="text/javascript"> 
            window.location = "'.$url.'" 
            </script>'; 
            exit("Javascript is turned off, <a href='$url'>click here to go to requested page</a>"); 
            }

    Может в кучу надо было?http://forum.antichat.ru/threadnav19997-48-10.html

    bot-minurast, 02 Ноября 2011

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