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

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

    +154

    1. 1
    2. 2
    3. 3
    foreach ($templatedata as $templatedataname=>$templatedatavalue)
    	$$templatedataname = $templatedatavalue;
    include($templatesDir.'/'.$file.'.tpl.php');

    Велошаблонизатор, превращающий пары ключ-значение из массива в локальные переменные шаблона.
    Шаблон - простой php-файл, в нужных местах выводящий полученные значения (реже с какой-либо логикой вроде обработки массива).

    Vindicar, 13 Июня 2011

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

    +147

    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
    Query query = entityManager.createNativeQuery(
                            "select * from ("
                                    + "select g4.id as goodId, g4.name as goodName, g4.code as goodCode, "
                                    + "u4.name as uomName, sum(bgd.quantity_out) as quantityOut, "
                                    + " g4.productcode as goodProductCode, sum(bgd.quantity_return) as quantityReturn "
                                    + "from good g4 "
                                    + "inner join consignment cs1 on cs1.good_id = g4.id "
                                    + (customizationUtilSQL == null ? "" : customizationUtilSQL.buildCustomAttributesQueryInnerPart())
                                    + " inner join "
                                    + "(select gg.consignment_id, op.sourcestore_id as place_id, " +
                                    		" sum(gg.quantity) as quantity_out, sum(coalesce(srset.return_quantity, 0)) as quantity_return "
                                    + "from motion gg "
                                    + "inner join operation op " +
                                    		" on (gg.operation_id = op.id " +
                                    		" and op.company = gg.company" +
                                            (projectId == null ? "" : " and (op.project_id  = :projectId) ") +
                                            (contractId == null ? "" : " and (op.contract_id  = :contractId) ") +
                                    		") "
                                    + "inner join place pld on op.sourcestore_id = pld.id "
                            		+ " left outer join "
                    				+ " (select ds.demand_id as demand_id, srm.consignment_id as consignment_id, srm.sum as sum, " +
                    						" sum(srm.quantity) as return_quantity from demand_salesreturn ds " +
                    						" inner join operation sr on sr.id = ds.salesreturn_id " +
                    						" inner join motion srm on srm.operation_id = sr.id " +
                    						" where sr.dtype = 'SalesReturn' " +
                                            " and sr.deleted is null " +
                                            (!includeAboardOperations ? " and sr.applicable = true " : "") +
                                            " and (sr.moment between :upToDate and :toDate) " +
                                            " and " + SecurityUtil.companyFilterSQL("sr") +
                    						" group by ds.demand_id, srm.consignment_id, srm.sum) srset " +
                    						" on (srset.demand_id = op.id and srset.sum = gg.sum " +
                    						" and srset.consignment_id = gg.consignment_id) "
                                    + (agentId == null ? "" :
                                        " left outer join requisite tr on op.targetagentrequisite_id = tr.id "
                                        + " left outer join requisite sr on op.sourceagentrequisite_id = sr.id "
                                        + " left outer join agent agt on tr.agent_id = agt.id "
                                		+ " left outer join agent ags on sr.agent_id = ags.id ")
                                    + "where " + SecurityUtil.companyFilterSQL("op")
                                    + " and op.deleted is null "
                                    + (!includeAboardOperations ? " and op.applicable = true " : "")
                                    + " and (op.moment between :upToDate and :toDate) "
                                    + " and op.dtype = 'Demand' "
                                    + (agentId == null ? ""
                                        : " and ((ags.path || ags.id) like ( "
                                            + "select distinct (a21.path || a21.id || '%') from agent a21  where a21.id = :agentId) or "

    всё не влезло, вообще тут 65 строк. пожалуйста выскажите ваше мнение об этом коде. спасибо :)

    ab368, 09 Июня 2011

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

    +135

    1. 1
    <td class="displayNone" style="padding-right:13px; width:235px" valign="top">

    ticket.rzd.ru

    sapegin, 18 Мая 2011

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

    +166

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    function unlinkFile($filename) {
      if(unlink($filename)) {
        return true;
      }
    }
    	
    function unsetVar($varname) {
      unset($varname);
      return true;
    }

    Одна из "библиотек" крупного зарубежного коммерческого проекта.

    Ring, 04 Мая 2011

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

    +135

    1. 1
    <div class="block_container s3 b-text b-static-text  user_css_130018946673 user_css_130028521958 user_css_130028524445 user_css_130028527350 user_css_130028529275 user_css_130028546858 user_css_13002855067 user_css_13002855515 user_css_130028558859 user_css_130028563869 user_css_130028573655 user_css_130028575861 user_css_130028716271 " id="e_130012850667">

    С одного narod'овского сайта на готовом шаблоне. Я на измене.

    telnet, 28 Апреля 2011

    Комментарии (29)
  7. Java / Говнокод #6491

    +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
    public class MyActivity extends Activity {
         protected void onCreate(Bundle icicle) {
             super.onCreate(icicle);
    
             setContentView(R.layout.content_layout_id);
    
             final CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox_id);
             if (checkBox.isChecked()) {
                 checkBox.setChecked(false);
             }
         }
     }

    toxicDuck, 27 Апреля 2011

    Комментарии (29)
  8. Pascal / Говнокод #6343

    +96

    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
    procedure TForm1.FormCreate(Sender: TObject);
    begin
    Image1.Transparent:=true;
    Image1.Picture.LoadFromFile('ab.bmp');
    
    
    inbot:='1';
    wkbot:='1';
    Memo1.Text:='';
    
    with Form1 do
    SetWindowPos(Handle,
    HWND_TOPMOST,
    Left,
    Top,
    Width,
    Height,
    SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
    
    statusbar1.Panels.Items[0].Text:='Клиент подключон'; 
    si:='log.txt';
    assignfile(fi,si);
    reset(fi);
    for i:=0 to 1590 do begin
    Readln(fi, a);
    b:=b+a;
    end;
    Memo1.Lines.Add(b);
    CloseFile(fi);
    statusbar1.Panels.Items[0].Text:='Ожидание подключения клиента';
    Button2.Enabled:=false;
    end;

    Ещё один говнокод от ВебКилла. MOAR!!!!111: http://3.webkill.ru/socket_messager.html

    Govnocoder#0xFF, 13 Апреля 2011

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

    +149

    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
    <?php
      ...
      echo "<table border=1>";
      for($j = 0; $j < 7; $j++)
      {
        echo "<tr>";
        for($i = 0; $i < count($week); $i++)
        {
          if(!empty($week[$i][$j]))
          {
           
            
            if($j == 5 || $j == 6) 
                 echo "<td><font color=red>".$week[$i][$j]."</font></td>";
            else echo "<td>".$week[$i][$j]."</td>";
          }
          else echo "<td>&nbsp;</td>";
        }
        echo "</tr>";
      } 
      echo "</table>";
    ?>

    Колендарик =) хочу сделать windows в виде html,это реально сделать?точней ввиде"сайта"

    BlackMonolit, 11 Апреля 2011

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

    +168

    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
    template <typename T> T min3 (T v1, T v2, T v3) {
      T min = v1;
      if (min > v2)
        min = v2;
      if (min > v3)
        min = v3;
      return min;
    };
    
    template <typename T> T max3 (T v1, T v2, T v3) {
      T max = v1;
      if (max < v2)
        max = v2;
      if (max < v3)
        max = v3;
      return max;
    };

    Как говорится - главное, чтоб работало.

    panter_dsd, 04 Апреля 2011

    Комментарии (29)
  11. Куча / Говнокод #5987

    +141

    1. 1
    http://respect.lg.ua/

    Смотрим хтмл код в самом низу.

    alex322, 15 Марта 2011

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