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

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

    +136

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    int num10 = Convert.ToInt16(this.label13.Text);
        int num11 = Convert.ToInt16(this.label11.Text);
        int num12 = Convert.ToInt16(this.LH2.Text);
        int num13 = Convert.ToInt16(this.dmserver.Text);
        int num14 = Convert.ToInt16(this.vipserver.Text);
        int num15 = Convert.ToInt16(this.NAMALSK_FREE_server.Text);
        int num16 = Convert.ToInt16(this.Igromafia_serevr.Text);
        int num18 = Convert.ToInt16(this.LH3_total_on_off.Text);
        int num17 = ((((((num10 + num11) + num13) + num14) + num15) + num12) + num16) + num18;
        this.servers.Text = Convert.ToString(num17);

    Часть метода статистики одного из лаунчеров для пиратского клиента игры.

    kingmonstr, 03 Января 2015

    Комментарии (2)
  3. JavaScript / Говнокод #17394

    +154

    1. 1
    <input type="submit" name="sub" value="регистрация" class="buttom2_activ" onmouseover="this.className='buttom2_activ'" onmouseout="this.className='buttom2'">

    CSS :hover, лол

    heyzea1, 31 Декабря 2014

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

    +74

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    private void showProgress() {
        if(mIndProgressVisible && mIndProgress != null && mIndProgress.isShowing()) return;
        if(!mIndProgressVisible && (mIndProgress == null || !mIndProgress.isShowing())) return;
    
        ...
    }

    Не ходите, дети, в Африку гулять

    StanDalone, 30 Декабря 2014

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

    −124

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    Процедура Флажок1ПриИзменении(Элемент)
    	
    	//выбираем контрагента
    	ТК	= табК.найти(Контрагент, "контрагент");
    	
    	Первый	= 2+2;
    	для кк=0 по табК.Количество()-1 цикл
    		элементыформы.МаршрутныйЛистК.Область("C"+число(кк*3+1+Первый)).Видимость	= (ОтобразитьВсеМеста и ТабК[кк]=ТК);
    	конеццикла;	
    	
    	
    КонецПроцедуры

    Продукт "1С:Молокозавод. Международная поставка для пользователей "1С:Управление производственным предприятием "
    Форма документа "МОЛ_ЗаказПоМаршруту".
    Фирма "ЦНТУиК" (ЗАО "Центр научно-технических услуг и консультаций").
    Не понятно что они курят.

    x-salik, 18 Декабря 2014

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

    +73

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public static long inFuture(final long time, final long current, final int period) {
            long newtime = current;
            while (newtime < current) {
                newtime += period;
            }
            return newtime;
        }

    я сегодня продуктивен )
    на этот раз...
    последовательный инкремент = )

    Lure Of Chaos, 15 Декабря 2014

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

    +127

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    # Path for asterisk
    # Default Value: /usr/sbin/asterisk
    WHICH_asterisk=/usr/sbin/asterisk
    
    # Path for rm
    # Default Value: /bin/rm
    WHICH_rm=/bin/rm
    
    # Path for tail
    # Default Value: /usr/bin/tail
    WHICH_tail=/usr/bin/tail

    Конфигурационный файл amportal.conf в freepbx :)

    shinespb, 10 Декабря 2014

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

    +153

    1. 1
    2. 2
    3. 3
    var getSelectedTabName = function() {
      return $('#costs-category').find('.tabs-v4-i_active').find('.tabs-v4-l').data('category_alias');
    };

    Кто-то ниасилил селекторы в jquery

    fake, 01 Декабря 2014

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

    +134

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    private bool CompareLvlCats(string[] cat,List<string[]> cats, int lvl)
    {
        if (lvl == 1) return cats.Find(x => x[0] == cat[0] && (x[1] != cat[1] ||x[1]!="")) != null;
        if (lvl == 2) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && (x[2] != cat[2] || x[2] != "")) != null;
        if (lvl == 3) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && x[2] == cat[2] && (x[3] != cat[3] || x[3] != "")) != null;
        if (lvl == 4) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && x[2] == cat[2] && x[3] == cat[3] && (x[4] != cat[4] || x[4] != "")) != null;
        if (lvl == 5) return cats.Find(x => x[0] == cat[0] && x[1] == cat[1] && x[2] == cat[2] && x[3] == cat[3] && x[4] == cat[4] && (x[5] != cat[5] || x[5] != "")) != null;
        if (lvl == 6) return false;
        return false;
    }

    Здесь мы идём снова.

    pushistayapodmyshka, 29 Ноября 2014

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

    +51

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    QDir startupFolder = QDir(AppSettings->value("SoftStartupFolder").toString());
    if (!startupFolder.isAbsolute())
    {
        startupFolder.setPath(QCoreApplication::applicationDirPath()+QDir::separator()+AppSettings->value("SoftStartupFolder").toString());
        startupFolder = QDir(startupFolder.absolutePath());
    }

    а иначе дальше файлы будут честно искаться в папке с названиями из точки или двух, а относительные пути браться от чего угодно кроме текущей папки или папки с прогой.

    kin63camapa, 28 Ноября 2014

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

    +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
    private String shutdown = "SHUTDOWN";
    
    ........
    
    // Read a set of characters from the socket
    int expected = 1024; // Cut off to avoid DoS attack
    
    <--Зачем это тут?-->
    while (expected < shutdown.length()) {
        if (random == null)
            random = new Random();
        expected += (random.nextInt() % 1024);
    }
    
    
    while (expected > 0) {
        int ch = -1;
        try {
            ch = stream.read();
        } catch (IOException e) {
            log.warn("StandardServer.await: read: ", e);
            ch = -1;
        }
        if (ch < 32)  // Control character or EOF terminates loop
            break;
        command.append((char) ch);
        expected--;
    }

    Не понимаю зачем тут while. Авторы Apache Tomcat расскажите...

    mrFoxs, 25 Ноября 2014

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