1. Поиск говнокода

    Этот поиск практически ничего не может найти! Но вы всё-таки попытайтесь, вдруг повезет.

    Найдено: 210

  2. PHP / Говнокод #3300

    +160

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <?$APPLICATION->IncludeFile(
    			$APPLICATION->GetTemplatePath("include_areas/contacts.php"),
    			Array(),
    			Array("MODE"=>"html")
    		);?> </div>

    Вот так индусские проггеры из Bitrix показывают контакты сайта.

    aleferov, 24 Мая 2010

    Комментарии (34)
  3. PHP / Говнокод #3272

    +162

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    static public function checkFingerprint($fingerprint = null)
    {
        $user = ServiceFactory::getServiceUsers()->getByID((int)$_COOKIE['__MW__accountID']);
        $fingerprint = (isset($fingerprint)) ? $fingerprint : Users::getFingerprint();
        $flag = (bool)($fingerprint == $user->generateFingerprint());
        if ( $flag )
          return $user->userID;
        else
          return 0;
    }

    не только индусские разработчики бывают весёлыми - это творение взрослого афроамериканского собрата. Перестраховался везде где только мог. Особенно доставляет приведение к bool результата сравнения :)

    newmindcore, 19 Мая 2010

    Комментарии (15)
  4. Pascal / Говнокод #2972

    +110

    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
    Function IsBigLet(Let: String): Boolean;
    var r: bool;
    begin
    r:=false;
    if pos('Й',Let)>0 then r:=true;
    if pos('Ц',Let)>0 then r:=true;
    if pos('У',Let)>0 then r:=true;
    if pos('К',Let)>0 then r:=true;
    if pos('Е',Let)>0 then r:=true;
    if pos('Н',Let)>0 then r:=true;
    if pos('Г',Let)>0 then r:=true;
    if pos('Ш',Let)>0 then r:=true;
    if pos('Щ',Let)>0 then r:=true;
    if pos('З',Let)>0 then r:=true;
    if pos('Х',Let)>0 then r:=true;
    if pos('Ф',Let)>0 then r:=true;
    if pos('Ы',Let)>0 then r:=true;
    if pos('В',Let)>0 then r:=true;
    if pos('А',Let)>0 then r:=true;
    if pos('П',Let)>0 then r:=true;
    if pos('Р',Let)>0 then r:=true;
    if pos('О',Let)>0 then r:=true;
    if pos('Л',Let)>0 then r:=true;
    if pos('Д',Let)>0 then r:=true;
    if pos('Ж',Let)>0 then r:=true;
    if pos('Э',Let)>0 then r:=true;
    if pos('Я',Let)>0 then r:=true;
    if pos('Ч',Let)>0 then r:=true;
    if pos('С',Let)>0 then r:=true;
    if pos('М',Let)>0 then r:=true;
    if pos('И',Let)>0 then r:=true;
    if pos('Т',Let)>0 then r:=true;
    if pos('Б',Let)>0 then r:=true;
    if pos('Ю',Let)>0 then r:=true;
    Result:=r;
    end;

    Немножко индусского кода!

    Temnenkov, 09 Апреля 2010

    Комментарии (23)
  5. JavaScript / Говнокод #2796

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    function isValidEmail(address) {
        if (address.indexOf('@') < 1) return false;
        var name = address.substring(0, address.indexOf('@'));
        var domain = address.substring(address.indexOf('@') + 1);
        if (name.indexOf('(') != -1 || name.indexOf(')') != -1 || name.indexOf('<') != -1 || name.indexOf('>') != -1 || name.indexOf(',') != -1 || name.indexOf(';') != -1 || name.indexOf(':') != -1 || name.indexOf('\\') != -1 || name.indexOf('"') != -1 || name.indexOf('[') != -1 || name.indexOf(']') != -1 || name.indexOf(' ') != -1) return false;
        if (domain.indexOf('(') != -1 || domain.indexOf(')') != -1 || domain.indexOf('<') != -1 || domain.indexOf('>') != -1 || domain.indexOf(',') != -1 || domain.indexOf(';') != -1 || domain.indexOf(':') != -1 || domain.indexOf('\\') != -1 || domain.indexOf('"') != -1 || domain.indexOf('[') != -1 || domain.indexOf(']') != -1 || domain.indexOf(' ') != -1) return false;
        return true;
    }

    проверка email на валидность по индусски

    avm, 15 Марта 2010

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

    +144.9

    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
    bool userNameChanged = true;
    bool passwordChanged = true;
    
    if(userNameChanged)
    {
    	// какие-то операции
    }
    
    if(passwordChanged)
    
    {
    	// ещё какие-то операции
    }

    Вот ещё один код от нашего шефа-индуса...

    Highlander, 27 Февраля 2010

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

    +86.8

    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
    ...
    String tmp = null;
    String age = null;
    ...
    tmp = hdrInfo.getAge();
    if( tmp != null )
    {
      age = tmp.substring( 0, tmp.length( ) - 1 );
      if( !age.equals( "0" ) ) {
        age = age;
      } else {
        age="";
      }
    } else {
      age="";
    }

    Индусско-выверенный код.

    Underdark, 16 Февраля 2010

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

    +144.8

    1. 1
    2. 2
    3. 3
    4. 4
    $div = ($account->typeID == 1) ? true : false;
    if ($div == true) {
      // blablabla
    }

    И ведь не индус, а всё туда же.

    newmindcore, 15 Февраля 2010

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

    −357.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    -(bool)hasInternetConnection
    {
        return true;
    }
    
    -(void)checkInternetConnection
    {
        NSLog(@"checking connection");
        mTmp.loggedIn = ([self hasInternetConnection]==YES) ? 0 : -1;
    }

    Мой начальник-тимлид, американский индус по происхождению, узнав, что я уже несколько часов потратил на попытки неизвращенной реализации нужного нам "простого" функционала, сказал, что поможет мне, хоть я и не просил.
    Уже через несколько минут я увидел у себя вот эти строки...

    P.S. если кто не знает, то код на Objective-C

    Highlander, 13 Февраля 2010

    Комментарии (12)
  10. JavaScript / Говнокод #2577

    +176.5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    e=0.55;
    c=e.toString().split('.')[0];
    k=e.toString().split('.')[1].substr(0, 1);
    r=parseInt(c);
    if (k > 4) r=r+1;

    Округление числа старинным индусским способом

    fuckyounoob, 09 Февраля 2010

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

    +61

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    function Dec2Hex V = 
    (
    local H
    if V == 0 then H = "00"
    else if V == 1 then H = "01"
    else if V == 2 then H = "02"
    /* и так далее до 253 */
    else if V == 254 then H = "FE"
    else if V == 255 then H = "FF"
    )

    Очень плохой, индусский способ реализации Decimal to Hex конверсии.

    Shitafaka, 07 Февраля 2010

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