1. PHP / Говнокод #10285

    +72

    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
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    /* Данные пользователя*/
    $fio=$_POST['fio'];
    $sex=$_POST['sex'];
    $sdate=$_POST['sdate'];
    $city=$_POST['city'];
    $age=$_POST['age'];
    $hage=$_POST['hage'];
    $cage=$_POST['cage'];
    $page=$_POST['page'];
    $stime=$_POST['stime'];
    $ip=$_POST['ip'];
    /* Вопросы*/
    $a1=$_POST['a1'];
    $a1b1=$_POST['1a1'];
    $a1b2=$_POST['1a2'];
    $a1b3=$_POST['1a3'];
    $a1b4=$_POST['1a4'];
    $com1=$_POST['com1'];
    $a2=$_POST['a2'];
    $a2b1=$_POST['2a1'];
    $a2b2=$_POST['2a2'];
    $com2=$_POST['com2'];
    $a3=$_POST['a3'];
    $b1a1=$_POST['b1a1'];
    $b1a2=$_POST['b1a2'];
    $b1a3=$_POST['b1a3'];
    $a4=$_POST['a4'];
    $a3b1=$_POST['3a1'];
    $a3b2=$_POST['3a2'];
    $a3b3=$_POST['3a3'];
    $a3b4=$_POST['3a4'];
    $a3b5=$_POST['3a5'];
    $a3b6=$_POST['3a6'];
    $a3b7=$_POST['3a7'];
    $a3b8=$_POST['3a8'];
    $a3b9=$_POST['3a9'];
    $a3b10=$_POST['3a10'];
    $com3=$_POST['com3'];
    $a5=$_POST['a5'];
    $b2a1=$_POST['b2a1'];
    $b2a2=$_POST['b2a2'];
    $b2a3=$_POST['b2a3'];
    $a6=$_POST['a6'];
    $a4b1=$_POST['4a1'];
    $a4b2=$_POST['4a2'];
    $a4b3=$_POST['4a3'];
    $a4b4=$_POST['4a4'];
    $a4b5=$_POST['4a5'];
    $a4b6=$_POST['4a6'];
    $a4b7=$_POST['4a7'];
    $com4=$_POST['com4'];
    $a7=$_POST['a7'];
    $b3a1=$_POST['b3a1'];
    $b3a2=$_POST['b3a2'];
    $b3a3=$_POST['b3a3'];
    $a8=$_POST['a8'];
    $a5b1=$_POST['5a1'];
    $a5b2=$_POST['5a2'];
    $a5b3=$_POST['5a3'];
    $a5b4=$_POST['5a4'];
    $a5b5=$_POST['5a5'];
    $a5b6=$_POST['5a6'];
    $a5b7=$_POST['5a7'];
    $a5b8=$_POST['5a8'];
    $a5b9=$_POST['5a9'];
    $a5b10=$_POST['5a10'];
    $a5b11=$_POST['5a11'];
    $com5=$_POST['com5'];
    $a9=$_POST['a9'];
    $a6b1=$_POST['6a1'];
    $a6b2=$_POST['6a2'];
    $a6b3=$_POST['6a3'];
    $a6b4=$_POST['6a4'];
    $a6b5=$_POST['6a5'];
    $a6b6=$_POST['6a6'];
    $a6b7=$_POST['6a7'];
    $a6b8=$_POST['6a8'];
    $com6=$_POST['com6'];
    
    echo "<CENTER>";
    echo "Привет, ".$_POST['fio'];
    echo "<BR><BR>";
    echo "Спасибо за ваш интерес.<BR><BR>";
    
    
    ....

    нашли в прокте вот такое извращение :)

    olegpro, 16 Мая 2012

    Комментарии (8)
  2. Java / Говнокод #10284

    +66

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    catch (com.google.gwt.event.shared.UmbrellaException ex) {
    					Iterator<Throwable> it = ex.getCauses().iterator();
    					while (it.hasNext()) {
    						Throwable msg = it.next();
    						System.out.println(msg.getStackTrace());
    					}

    обрабатываем exception......

    sermolaev, 16 Мая 2012

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

    +70

    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
    if(rightTable.isCellPresent(0, 0))
    					for(int i = 0; i < rightTable.getRowCount(); i++)
    						if(((CheckBox)((HorizontalPanel)rightTable.getWidget(i, 0)).getWidget(0)).getValue())
    						{	isChanged = true;
    							
    							leftTableList.add(currentTemplate.getColumns().get(i));
    							for(int j = 0; j < resultTable.getCellCount(0); j++)
    									if(((Label)((HorizontalPanel)resultTable.getWidget(0, j)).getWidget(1)).getText().compareTo(new Integer(currentTemplate.getColumns().get(i).getOrder()).toString()) == 0)
    										resultTable.removeCell(0, j);
    							
    							System.out.println(resultTable.getCellCount(0));
    							
    							rightTable.removeRow(i);
    							currentTemplate.getColumns().remove(i);
    							i--;
    						}

    sermolaev, 16 Мая 2012

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

    +78

    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
    private function isRussianCar($car){
    
                               # Определялка российских машин.
    
                                if ($car['make_id'] == '107') return true;
                                if ($car['make_id'] == '108') return true;
    		if ($car['make_id'] == '109') return true;
    		if ($car['make_id'] == '110') return true;
    		if ($car['make_id'] == '111') return true;
    		if ($car['make_id'] == '112') return true;
    		if ($car['make_id'] == '113') return true;
    		if ($car['make_id'] == '114') return true;
    		if ($car['make_id'] == '115') return true;
    		if ($car['make_id'] == '116') return true;
    		if ($car['make_id'] == '117') return true;
    		return false;
    	
        }

    Нашёл в одном из проектов

    daemon_master, 15 Мая 2012

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

    +71

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    $template_archive_footer = stripslashes(get_option('poll_template_pollarchivefooter'));
    		$template_archive_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_archive_footer);
    		$template_archive_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_archive_footer);

    wp-polls. пиздец.

    TBoolean, 15 Мая 2012

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

    +62

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if($col == "#eeeeee"){
    $col = "#ffffff";
    }else{
    $col = "#eeeeee";
    }

    Нашел на просторах интернета скрипт, а в нем вот это. $col нигде не присваивается.

    mxst, 15 Мая 2012

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

    +58

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    if ($who == 'student') $answerArray['student_id'] = $this->people->id;
    if ($who == 'teacher') $answerArray['teacher_id'] = $this->people->id;
    if ($who == 'student') $answerArray['student_text'] = $post_array['message'];
    if ($who == 'teacher') $answerArray['teacher_text'] = $post_array['message'];
    if ($who == 'student') $answerArray['student_date'] = date('Y-m-d H:i:s');
    if ($who == 'teacher') $answerArray['teacher_date'] = date('Y-m-d H:i:s');
    if ($who == 'student' && $files) $answerArray['student_file'] = $files[0]['name'];
    if ($who == 'teacher' && $files) $answerArray['teacher_file'] = $files[0]['name'];
    if ($who == 'student' && $files) $answerArray['student_file_orig_name'] = $files[0]['orig_name'];
    if ($who == 'teacher' && $files) $answerArray['teacher_file_orig_name'] = $files[0]['orig_name'];
    if ($who == 'student') $answerArray['status'] = 0;
    if ($who == 'teacher') $answerArray['status'] = 1;

    Обнаружил в корпоративном коде. )

    MikleSmart, 15 Мая 2012

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

    +71

    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
    /**
     * Get the river's access where clause
     *
     * @return string
     * @since 1.8.0
     * @access private
     */
    function elgg_river_get_access_sql() {
    	// rewrite default access where clause to work with river table
    	return str_replace("and enabled='yes'", '',
    		str_replace('owner_guid', 'rv.subject_guid',
    		str_replace('access_id', 'rv.access_id', get_access_sql_suffix())));
    }

    Кусок из ядра фремворка Elgg, Sql запрос подправляется с помощью str_replace

    piromanlynx1, 15 Мая 2012

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

    +93

    1. 1
    if (indSpec == false || indZone == false || (FRof != null && FRof == 2)) result = 1;

    Нашли в проекте вот такое "женское" условие. Видимо, префиксом "ind" автор намекала на своё происхождение.

    DukeGonzo, 15 Мая 2012

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

    +105

    1. 1
    if (wasteClass != null && wasteClass == 5)

    Все же знают, что целочисленные переменные бывают равны null и 5 одновременно.

    DukeGonzo, 15 Мая 2012

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