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

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

    +13

    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
    <?php
      $lines = file('quest.txt');
      if($_POST['Quest'] == "") {
        echo "<HTML>";
        echo "<HEAD>";
        echo "<TITLE>Тестер</TITLE>";
        echo "<script language=JavaScript type=text/javascript>";
        echo "<!-- " . "\n";
        echo "var differ = 90*60;";
        echo "function timer() {";
        echo "var hours, minutes, seconds;";
        echo "differ = differ - 1;";
        echo "document.forms['vopros'].TimeLeft.value=differ;";
        echo "hours = Math.floor(differ/(60*60));";
        echo "hours = (hours >= 60) ? hours%60 : hours;";
        echo "hours = (hours < 10) ? \"0\" + hours : hours;";
        echo "minutes = Math.floor(differ/(60));";
        echo "minutes = (minutes >= 60) ? minutes%60 : minutes;";
        echo "minutes = (minutes < 10) ? \"0\" + minutes : minutes;";
        echo "seconds = differ;";
        echo "seconds = (seconds >= 60) ? seconds%60 : seconds;";
        echo "seconds = (seconds < 10) ? \"0\" + seconds : seconds;";
        echo "var strDate =  hours + \":\" + minutes + \":\" + seconds;";
        echo "document.forms['timerForm'].timerBox.value=strDate;";
        echo "if (differ<=0) {";
        echo "  document.forms['vopros'].Quest.value=100;";
        echo "  vopros.submit();";
    ... (и так далее)

    Отличный кодец из дипломной работы студента!

    RigFox, 13 Ноября 2015

    Комментарии (179)
  3. Куча / Говнокод #14307

    +126

    1. 1
    shop_manager.WarnCurrentStoreNotTracked = Current store is not tracked. Please <a href="#" onclick="company.load_page(\'analytics/activate.html\', '{'\'{0}\': \'{1}\''}');">activate here</a> to start tracking.

    Файл properties в какой-то спринг-эм-вэ-цэ херне.

    wvxvw, 01 Января 2014

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

    +113

    1. 1
    2. 2
    Стартовал форум работы еще много,  тестить уже можно 
    http://gvforum.ru/

    Vasiliy, 28 Декабря 2013

    Комментарии (179)
  5. Куча / Говнокод #25108

    0

    1. 1
    Type: Null

    https://bulbapedia.bulbagarden.net/wiki/Type:_Null_(Pok%C3%A9mon)

    vistefan, 23 Ноября 2018

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

    +21

    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
    class socket_exception                                                                                                                        
    {                                                                                                                                              
    public:                                                                                                                                    
                char *buf;                                                                                                                             
                int ret;                                                                                                                               
                socket_exception()                                                                                                                    
                {                                                                                                                                      
                    buf=new char[10000];                                                                                                               
                    ret=RET_OK;                                                                                                                        
                }                                                                                                                                      
                socket_exception(char *b, int r)                                                                                                      
                {                                                                                                                                      
                    buf=new char[10000];                                                                                                               
                    snprintf(buf,9999,"%s",b);                                                                                                         
                    ret=r;                                                                                                                             
                }                                                                                                                                      
                socket_exception(vsocket_exception &ex)                                                                                               
                {                                                                                                                                      
                    buf=new char[10000];                                                                                                               
                    snprintf(buf, 9999, "%s", ex.buf);                                                                                                 
                    ret=ex.ret;                                                                                                                        
                }                                                                                                                                      
                const char * what (){return buf;}                                                                                                      
                int get_ret(){return ret;}                                                                                                             
                ~socket_exception(){delete[] buf;}                                                                                                    
    };

    фрактал

    roman-kashitsyn, 20 Июня 2013

    Комментарии (178)
  7. Pascal / Говнокод #8664

    +102

    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 naq(a:integer;n:integer;m:integer):string;
    var astr:string;
    begin
      astr:=inttostr(a);
         case m of
           1: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*1)+'*p^'+inttostr(n+1);
           2: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*2)+'*p^'+inttostr(n+1)+'+'+inttostr(a*1)+'*p^'+inttostr(n+2);
           3: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*3)+'*p^'+inttostr(n+1)+'+'+inttostr(a*3)+'*p^'+inttostr(n+2)+'-'+inttostr(a*1)+'*p^'+inttostr(n+3);
           4: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*4)+'*p^'+inttostr(n+1)+'+'+inttostr(a*6)+'*p^'+inttostr(n+2)+'-'+inttostr(a*4)+'*p^'+inttostr(n+3)+'+'+inttostr(a*1)+'*p^'+inttostr(n+4);
           5: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*5)+'*p^'+inttostr(n+1)+'+'+inttostr(a*10)+'*p^'+inttostr(n+2)+'-'+inttostr(a*10)+'*p^'+inttostr(n+3)+'+'+inttostr(a*5)+'*p^'+inttostr(n+4)+'-'+inttostr(a*1)+'*p^'+inttostr(n+5);
           6: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*6)+'*p^'+inttostr(n+1)+'+'+inttostr(a*15)+'*p^'+inttostr(n+2)+'-'+inttostr(a*20)+'*p^'+inttostr(n+3)+'+'+inttostr(a*15)+'*p^'+inttostr(n+4)+'-'+inttostr(a*6)+'*p^'+inttostr(n+5)+'+'+inttostr(a*1)+'*p^'+inttostr(n+6);
           7: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*7)+'*p^'+inttostr(n+1)+'+'+inttostr(a*21)+'*p^'+inttostr(n+2)+'-'+inttostr(a*35)+'*p^'+inttostr(n+3)+'+'+inttostr(a*35)+'*p^'+inttostr(n+4)+'-'+inttostr(a*21)+'*p^'+inttostr(n+5)+'+'+inttostr(a*7)+'*p^'+inttostr(n+6)+'-'+inttostr(a*1)+'*p^'+inttostr(n+7);
           8: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*8)+'*p^'+inttostr(n+1)+'+'+inttostr(a*28)+'*p^'+inttostr(n+2)+'-'+inttostr(a*56)+'*p^'+inttostr(n+3)+'+'+inttostr(a*70)+'*p^'+inttostr(n+4)+'-'+inttostr(a*56)+'*p^'+inttostr(n+5)+'+'+inttostr(a*28)+'*p^'+inttostr(n+6)+'-'+inttostr(a*8)+'*p^'+inttostr(n+7)+'+'+inttostr(a*1)+'*p^'+inttostr(n+8);
           9: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*9)+'*p^'+inttostr(n+1)+'+'+inttostr(a*36)+'*p^'+inttostr(n+2)+'-'+inttostr(a*84)+'*p^'+inttostr(n+3)+'+'+inttostr(a*126)+'*p^'+inttostr(n+4)+'-'+inttostr(a*126)+'*p^'+inttostr(n+5)+'+'+inttostr(a*84)+'*p^'+inttostr(n+6)+'-'+inttostr(a*36)+'*p^'+inttostr(n+7)+'+'+inttostr(a*9)+'*p^'+inttostr(n+8)+'+'+inttostr(a*1)+'*p^'+inttostr(n+9);
         end;
      end;

    Лень было искать алгоритм раскрытия (1-q)^n

    rob1nzon, 28 Ноября 2011

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

    +160

    1. 1
    2. 2
    3. 3
    4. 4
    $url = $_SERVER['HTTP_REFERER'];	
    	
    $pos = strrpos($url, 'id');
    $id = substr($url, $pos + 2);

    Получаем id человека)))

    OJA, 08 Октября 2011

    Комментарии (178)
  9. Куча / Говнокод #19683

    −2

    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
    // POST /login
    exports.login = function login(req, res) {
        var email = req.body.email;
        var password = req.body.password;
    
        security.rateLimitRequest( 'reset', req, function( err ) {
            if ( err )
                return res.status( 400 ).send( err );
            db.Account.find({email: email, password: password}, function(err, account) {
                if ( err )
                    return res.status( 400 ).send( err );
                account.getAccountStatistics(account, function(err, account) {
                    if ( err )
                        return res.status( 400 ).send( err );
                    account.incrementAccountLoginCount(account, function(err) {
                        if ( err )
                           return res.status( 400 ).send( err );
                        res.send(account);
                    });
                });
            });
        });
    });

    У меня радость во все поля:

    // POST /login
    exports.login = function *login() {
    var email = req.body.email;
    var password = req.body.password;

    try
    {
    // Throws an error if rate limit exceeded
    yield security.rateLimitRequest( 'reset', req );

    // Query MongoDB for account
    var account = yield db.Account.find({email: email, password: password});
    account.statistics = yield account.getAccountStatistics(account);

    // Increment login count
    yield account.incrementAccountLoginCount(account);

    this.body = account;
    }
    catch( err ) {
    // Return the error as JSON
    return res.status( 400 ).send( err );
    }
    });

    LispGovno, 23 Марта 2016

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

    +3

    1. 1
    2. 2
    foreach($arResult['ITEMS'] as $key => &$arItem) {
    		$priceRes2 = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 34, "PROPERTY_PERIOD" => 1, "PROPERTY_PERIOD_TYPE" => 85, "PROPERTY_OBJECT_RELATION" => $arItem['ID']), false, false, array("NAME"));

    "Я программист 1C-bitrix и с каждой новой итерацией я делаю новый запрос к инфоблоку."

    tutov2013, 01 Сентября 2015

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

    +119

    1. 1
    2. 2
    3. 3
    Почитываю иногда комменты на govnokod.ru
    Сложилось впечатление, что Stertor, bormand, kegdan, inkanus-gray, 1024--, и многие другие - один и тот же человек
    так ли это?

    besprincypniycentner, 04 Июля 2015

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