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

    В номинации:
    За время:
  2. Куча / Говнокод #19542

    +1

    1. 1
    Верните мой WCT!

    d_fomenok, 27 Февраля 2016

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

    +1

    1. 1
    function crooked_nail_create_item(){ ...

    Зато честно!

    deep, 26 Февраля 2016

    Комментарии (0)
  4. PHP / Говнокод #19522

    +1

    1. 1
    define('OKVED_TRY_BUILD_CHUNK_IF_IT_NOT_FOUND_IN_CHUNKCACHE', TRUE);

    Написал строчку и думаю - то ли я наговнокодил с названием, то ли соломки подстелил, так, что через месяц я ТОЧНО вспомню, зачем оно нужно...

    Arris, 24 Февраля 2016

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

    +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
    foreach ($child as $ch) {
                if ($ch->nodeName === 'w:style') {
                    $sum++;
                    if ($ch->hasAttributes()) {
                        /** @var DOMAttr $attribute */
                        foreach ($ch->attributes as $attribute) {
                            if ($attribute->name === 'styleId') {
                                if ($attribute->value == $sTempStyle) {
                                    /** @var DOMElement $styleNode */
                                    foreach ($ch->childNodes as $styleNode) {
                                        if (isset($styleNode->tagName) && $styleNode->tagName === 'w:basedOn') {
                                            $basedOn    = $styleNode->getAttribute('w:val');
                                            $properties = $this->wordStyle2Array($basedOn, $tagName, $properties);
                                        }
                                        if (isset($styleNode->tagName) && $styleNode->tagName === $tagName) {
                                            $elements = $styleNode->childNodes;
                                            /** @var DOMElement $element */
                                            foreach ($elements as $element) {
                                                if (isset($element->tagName)) {
                                                    switch ($element->tagName) {
                                                        case 'w:color':
                                                            if ($element->hasAttribute('w:val')) {
                                                                $properties['color']['hex'] = '#' . $element->getAttribute
                                                                    ('w:val');
                                                            }
                                                            break;
                                                        case 'w:rFonts':
                                                            if ($element->hasAttribute('w:ascii')) {
                                                                $properties['font_family'] = $element->getAttribute('w:ascii');
                                                            }
                                                            break;
                                                        //кейсы - бесконечные как осень в России
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

    Чувак, мы слышали ты любишь плодить уровни вложенности, поэтому мы написали switch в if в foreach в if в foreach в if в if в foreach в if в if в foreach, кажется.

    mad_money, 24 Февраля 2016

    Комментарии (7)
  6. JavaScript / Говнокод #19507

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    #pragma strict 
     
    function Start () { 
    function OnMouseDown (); { 
     if(name=="new") { Application.LoadLevel("procedural"); } 
     if(name=="set") { } 
     if(name=="exit") { Application.Quit(); } 
     
    } 
     
    }

    mittorn, 21 Февраля 2016

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    <span style="font-size: 16px; line-height: 12px;">
      <b style="color: rgb(255, 102, 102);background-color:rgb(255, 204, 204);">
        <span <a href="news/"><b style="color:rgb(153, 102, 0);">Новости</b></span>
    ________________________________________________________</b></span>

    html код на одном сайте

    t3dev, 21 Февраля 2016

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $row['sub']=str_replace("{&amp;quot;",'{"',$row['sub']);
        $row['sub']=str_replace("&amp;quot;:&amp;quot;",'":"',$row['sub']);
        $row['sub']=str_replace("&quot;",'"',$row['sub']);
        $row['sub']=str_replace("&amp;",'"',$row['sub']);
        $row['sub']=str_replace("quot;:quot;",'":"',$row['sub']);
        $row['sub']=str_replace("{quot;",'{"',$row['sub']);
        $row['sub']=str_replace("quot;}",'"}',$row['sub']);
        $row['sub']=str_replace("quot;:",'":',$row['sub']);
        $sub = json_decode($row['sub']);

    CoolCoder, 12 Февраля 2016

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

    +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
    44. 44
    $sql = array();
    foreach ($stats as $date => $array) {
        $where="";
        $where = array();
        $where['date'] = $date;
        foreach ($array as $sub => $array1) {
    
            $where['sub'] = $nosqlmap->text($sub);
    
            foreach ($array1 as $webmaster => $array2) {
                $where['user']=$webmaster;
    
    
                foreach ($array2 as $offer => $array3) {
                    $where['offer'] = $offer;
    
                    foreach ($array3 as $promo => $array4) {
                        $where['promo'] = $promo;
    
                        foreach ($array4 as $potoc => $array5) {
    
                            $where['potoc'] = $nosqlmap->o9($potoc);
    
                            if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['orders'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['orders'] = 0;
                            if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['aprove'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['aprove'] = 0;
                            if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['noorder'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['noorder'] = 0;
                            if (!isset($stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['money'])) $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['money'] = 0;
    
                            $where['unics'] = $array5['unics'];
                            $where['hits'] = $array5['hits'];
                            $where['orders'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['orders'];
                            $where['aprove'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['aprove'];
                            $where['noorder'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['noorder'];
                            $where['money'] = $stats_o[$date][$sub][$webmaster][$offer][$promo][$potoc]['money'];
                            $sql[] = $where;
                        }
    
                    }
    
                }
            }
    
        }
    }

    CoolCoder, 12 Февраля 2016

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

    +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
    $error = 0;
                list($date, $time) = explode(' ', $_POST['date_till']);
                if (isset($date) && isset($time)) {
                    list($day, $month, $year) = explode('.', $date);
                    list($hour, $min) = explode(':', $time);
                    if (isset($day) && isset($month) && isset($year) && isset($hour) && isset($min)) {
                        $date_till = "$year-$month-$day $hour:$min:00";
                        $executed = Groups::setOutOfRangeGroups($date_till);
                        if (!$executed) {echo 'q';
                            $error = 1;
                        }
                    } else {echo 'w';
                        $error = 1;
                    }
                } else {echo 'e';
                    $error = 1;
                }

    Нормальные герои всегда идут в обход!

    deep, 12 Февраля 2016

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

    +1

    1. 1
    bool isNoGoodCommentText = String.IsNullOrEmpty(this.txbxCommentCtrl.Text) || String.IsNullOrWhiteSpace(this.txbxCommentCtrl.Text);

    И действительно, is not good

    pipjaka, 05 Февраля 2016

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