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. Куча / Говнокод #14293

    +113

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

    Vasiliy, 28 Декабря 2013

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

    0

    1. 1
    IT Оффтоп #238

    #208: https://govnokod.ru/29060 https://govnokod.xyz/_29060
    #209: https://govnokod.ru/29070 https://govnokod.xyz/_29070
    #210: https://govnokod.ru/29079 https://govnokod.xyz/_29079
    #211: https://govnokod.ru/29092 https://govnokod.xyz/_29092
    #212: https://govnokod.ru/29093 https://govnokod.xyz/_29093
    #213: https://govnokod.ru/29104 https://govnokod.xyz/_29104
    #214: https://govnokod.ru/29114 https://govnokod.xyz/_29114
    #215: https://govnokod.ru/29125 https://govnokod.xyz/_29125
    #216: https://govnokod.ru/29132 https://govnokod.xyz/_29132
    #217: https://govnokod.ru/29147 https://govnokod.xyz/_29147
    #218: https://govnokod.ru/29156 https://govnokod.xyz/_29156
    #219: https://govnokod.ru/29166 https://govnokod.xyz/_29166
    #220: https://govnokod.ru/29181 https://govnokod.xyz/_29181
    #221: https://govnokod.ru/29185 https://govnokod.xyz/_29185
    #222: https://govnokod.ru/29190 https://govnokod.xyz/_29190
    #223: https://govnokod.ru/29203 https://govnokod.xyz/_29203
    #224: https://govnokod.ru/29211 https://govnokod.xyz/_29211
    #225: https://govnokod.ru/29212 https://govnokod.xyz/_29212
    #226: https://govnokod.ru/29218 https://govnokod.xyz/_29218
    #227: https://govnokod.ru/29220 https://govnokod.xyz/_29220
    #228: https://govnokod.ru/29230 https://govnokod.xyz/_29230
    #229: https://govnokod.ru/29235 https://govnokod.xyz/_29235
    #230: https://govnokod.ru/29241 https://govnokod.xyz/_29241
    #231: https://govnokod.ru/29246 https://govnokod.xyz/_29246
    #232: https://govnokod.ru/29249 https://govnokod.xyz/_29249
    #233: https://govnokod.ru/29253 https://govnokod.xyz/_29253
    #234: https://govnokod.ru/29259 https://govnokod.xyz/_29259
    #235: https://govnokod.ru/29262 https://govnokod.xyz/_29262
    #236: https://govnokod.ru/29267 https://govnokod.xyz/_29267
    #237: https://govnokod.ru/29271 https://govnokod.xyz/_29271

    nepeKamHblu_nemyx, 28 Июля 2026

    Комментарии (178)
  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. C# / Говнокод #26533

    +1

    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
    using System;
     
    namespace Test
    {
        public class HttpException : Exception
        {
            public HttpException(int status)
            {
                StatusCode = status;
            }
     
            public int StatusCode { get; set; }
        }
     
        class Program
        {
            static void TestCatch(int status)
            {
                try
                {
                    throw new HttpException(status);
                }
                catch (HttpException ex) when (ex.StatusCode == 404)
                {
                    Console.WriteLine("Not Found!");
                }
                catch (HttpException ex) when (ex.StatusCode >= 500 && ex.StatusCode < 600)
                {
                    Console.WriteLine("Server Error");
                }
                catch (HttpException ex)
                {
                    Console.WriteLine("HTTP Error {0}", ex.StatusCode);
                } 
            }
            static void Main(string[] args)
            {
                TestCatch(404);
                TestCatch(501);
                TestCatch(101);
            }
        }
    }

    https://ideone.com/zXstg3
    Именно поэтому я за «C#».

    gost, 27 Марта 2020

    Комментарии (177)
  10. Куча / Говнокод #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)
  11. 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)