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

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

    +28

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if (0) {
    ?>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
            <tr class="infoBoxContents">
              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr> .... . ...

    Фрагментик из крелоада(CRELoaded).
    Жёсткая дискретная логика!

    guest, 16 Января 2009

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

    +28

    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
    this.sector = this.neo.MoveTo(gameTime, out startLive, out steps);                
    
    if (!FP)
    {
        //stepCnt += steps;
        showCard = true;
        FP = true;
    }
    
    // БЫЛО: bool[] btnCard = this.cm.GetCard(stepCnt, out card, this.neo);
    // СТАЛО:
    bool[] btnCard = this.cm.GetCard(neo.Cursector, out card, this.neo);
    
    // ...  НО ИЗЗА ТАКИХ МЕСТ В КОДЕ ЭТО ПИЗДЕЦ КАК СЛОЖНО!
    if (this.card == null)
    {
        //stepCnt -= 29;
        //btnCard = this.cm.GetCard(stepCnt, out card, this.neo);
        btnCard = this.cm.GetCard(neo.Cursector, out card, this.neo);
    }

    guest, 22 Декабря 2008

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

    +28

    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
    $sp_filter = array(0, '', '', '', '', '', '', 1, 1, 'desc', $id);
    	
    		$data = new vtSpotlight_Show($sp_filter); 
    
    
    		$table = $data->getTable();
    		$fields = $data->getFields();
     
    (...)
    
    		if(empty($table[0]['transcriber_concat']))
    		{
    			unset($table[0]['transcriber_concat']);
    			unset($fields[5]); ///  Удаление картикни T, если поле не содержит имени транскрибера
    		}
    	
    		$spotlight = $table[0];

    паттерн на паттерне одним словом...

    guest, 16 Декабря 2008

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

    +28

    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
    function check_finished_pending() {
    
    var v_wrt_id = document.getElementById('writer_id').value;
    
    if( 6 == 26 )
    {
    return confirm("Status 'finished pending' confirmation:\nAre you sure you made all needed operations on this order?");
    }
    else
    {       //var normal_writer_id = 2520;
    	if (( v_wrt_id != '2520' && v_wrt_id != 0))
    	{
    	//alert(v_wrt_id);
    	window.open('writer_add_select.php?fid=2020727&writer_id='+v_wrt_id, 'Assign writer', 'location,width=650,height=600,top=0');
    	return false;
    	}
    	else return confirm('Save?');
    }

    Правлю функции JS, тут такое чудо с мега условием попалось....

    guest, 15 Декабря 2008

    Комментарии (2)
  6. C++ / Говнокод #171

    +28

    1. 1
    namespace ? = boost::lambda;

    навеяно http://www.govnokod.ru/165

    guest, 14 Декабря 2008

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

    +28

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    // country
    if($user_country) {
    	$where .= '(tbl_publications.id_country = '.$user_country;
    	// city
    	if($user_city) {
    		$where .= ' OR tbl_publications.id_city = '.$user_city;
    	}
    	$where .= ')';
    }else{
    	$where .= ' 1=1'; // black magic
    }

    черная магия.

    guest, 14 Декабря 2008

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

    +27.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function createErrorObj($strField, $bDisplay = 'false', $format = false, $strTitle = null) {
    		
      global $Error, $__error;
      if (!$Error) {  
    	ErrorsHandling::_create();
      }
    		
      if ($bDisplay !== 'true') { 
    	$bDisplay = 'false';
      }
    ....

    страшный для кого-то был $bDisplay

    guest, 26 Января 2009

    Комментарии (0)
  9. PHP / Говнокод #25

    +27.8

    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
    $bCancel = false;
    while(!$bCancel)
    {
    	$bCnt++;
    	$sql = "SELECT id, rDateTime, pDateTime, longitude, latitude, speed, reportId, inputs, peopIn, peopOut, COUNT(*) AS cnt FROM $tbname AS tblCur
    			WHERE ".$repIds." AND pDateTime>'$fd' AND unitId=$unitid
    			GROUP BY pDateTime, reportId ORDER BY pDateTime ASC LIMIT 0, 50";
    	$request = mysql_query($sql) or die(mysql_error());
    	$rCnt = 0;
    	while(!$bCancel)
    	{
    		if($row=mysql_fetch_assoc($request))
    		{
    			if(!arrZoneCoordContains($row['longitude'],$row['latitude'],$arrZoneCoord[$zoneId]))
    			{
    				$bCancel = true;
    			}
    			$fd = $row['pDateTime'];
    	   		array_push($arrRows, $row);
    			$rCnt++;
    		}
    		elseif($rCnt==0)
    		$bCancel=true;
    	}
    }

    O break'aх мы не знаем.

    guest, 27 Ноября 2008

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

    +27.7

    1. 1
    2. 2
    3. 3
    4. 4
    $int = (int) $int;
    if (is_int($int)) { // на всякий случай
       // ...
    }

    Идея где-то валяется в залежах башорга.

    guest, 11 Декабря 2008

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

    +27.5

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    if ("$payment_method" ==  "1") {
    
    ?>

    еще один шедевр, зачем так делать?

    guest, 08 Января 2009

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