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

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

    −96

    1. 1
    {% verbatim %}{{ setExpireValue({% endverbatim %}{{ value }}{% verbatim %}) }}{% endverbatim %}

    AngularJS + Django, люди доходят до ручки.

    YourPM, 24 Октября 2014

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

    +153

    1. 1
    document.body.innerHTML = document.body.innerHTML.replace(/guest/g, '');<

    DesmondHume, 23 Октября 2014

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

    +170

    1. 1
    2. 2
    $time_now=date('d');
    $tomorrow =date('d')+'1';

    Кого-то ожидает 32 декабря.

    alxkolm, 23 Октября 2014

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

    +86

    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
    public PriceComparator {
    
       private PriceComparator INSTANCE;
    
        public PriceComparator() {
            INSTANCE = this;
        }
    
        public PriceComparator getInstance() {
            return INSTANCE;
        }
    
    ...
    }

    Singleton fail...

    StanDalone, 22 Октября 2014

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

    +159

    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
    function verifyType($type){
            switch ($type){
                case 'cs':
                    $this->serverType = $type;
                    require_once $this->serverType.'Inc.php';
                    break;
                case 'css':
                    $this->serverType = $type;
                    require_once $this->serverType.'Inc.php';
                    break;
                case 'cssold':
                    $this->serverType = $type;
                    require_once $this->serverType.'Inc.php';
                    break;
                case 'samp':
                    $this->serverType = $type;
                    require_once $this->serverType.'Inc.php';
                    break;
                default:
                    Error::add('Ошибка', 'Тип сервера указан неверно!');
            }
        }

    Очередной высер чудо-программистов. Еще одна панель управления игровыми серверами

    Onotole, 18 Октября 2014

    Комментарии (7)
  7. PHP / Говнокод #16884

    +160

    1. 1
    2. 2
    3. 3
    4. 4
    if($course==1) $max_semester = 2;
    if($course==2) $max_semester = 4;
    if($course==3) $max_semester = 6;
    if($course==4) $max_semester = 8;

    saksmt, 17 Октября 2014

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

    +93

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if (CurrentPlugin=nil) and (CurrentPlugin.FileName<>'InfoRTF.dll') and (CurrentPLugin.FileName<>'Preview.dll')  then begin
        if not ServerStoped then begin
            uPluginControl.StopSession();
        end;
        if ClientLoaded then begin
            ClientLoaded:=false;
            StartDemo();
        end;
    end;

    Смеяться на первой же строчке.
    Привет Алексу.

    hdkeeper, 17 Октября 2014

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

    +157

    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
    class ModelCheckoutOrder extends Model { 
     public function addOrder($data) {
        $data['login']=md5(rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100).rand(0,100));
      $this->db->query("INSERT INTO `" . DB_PREFIX . "order` SET login='".$data['login']."',invoice_prefix = '" . $this->db->escape($data['invoice_prefix']) . "', store_id = '" . (int)$data['store_id'] . "', store_name = '" . $this->db->escape($data['store_name']) . "', store_url = '" . $this->db->escape($data['store_url']) . "', customer_id = '" . (int)$data['customer_id'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', payment_firstname = '" . $this->db->escape($data['payment_firstname']) . "', payment_lastname = '" . $this->db->escape($data['payment_lastname']) . "', payment_company = '" . $this->db->escape($data['payment_company']) . "', payment_company_id = '" . $this->db->escape($data['payment_company_id']) . "', payment_tax_id = '" . $this->db->escape($data['payment_tax_id']) . "', payment_address_1 = '" . $this->db->escape($data['payment_address_1']) . "', payment_address_2 = '" . $this->db->escape($data['payment_address_2']) . "', payment_city = '" . $this->db->escape($data['payment_city']) . "', payment_postcode = '" . $this->db->escape($data['payment_postcode']) . "', payment_country = '" . $this->db->escape($data['payment_country']) . "', payment_country_id = '" . (int)$data['payment_country_id'] . "', payment_zone = '" . $this->db->escape($data['payment_zone']) . "', payment_zone_id = '" . (int)$data['payment_zone_id'] . "', payment_address_format = '" . $this->db->escape($data['payment_address_format']) . "', payment_method = '" . $this->db->escape($data['payment_method']) . "', payment_code = '" . $this->db->escape($data['payment_code']) . "', shipping_firstname = '" . $this->db->escape($data['shipping_firstname']) . "', shipping_lastname = '" . $this->db->escape($data['shipping_lastname']) . "', shipping_company = '" . $this->db->escape($data['shipping_company']) . "', shipping_address_1 = '" . $this->db->escape($data['shipping_address_1']) . "', shipping_address_2 = '" . $this->db->escape($data['shipping_address_2']) . "', shipping_city = '" . $this->db->escape($data['shipping_city']) . "', shipping_postcode = '" . $this->db->escape($data['shipping_postcode']) . "', shipping_country = '" . $this->db->escape($data['shipping_country']) . "', shipping_country_id = '" . (int)$data['shipping_country_id'] . "', shipping_zone = '" . $this->db->escape($data['shipping_zone']) . "', shipping_zone_id = '" . (int)$data['shipping_zone_id'] . "', shipping_address_format = '" . $this->db->escape($data['shipping_address_format']) . "', shipping_method = '" . $this->db->escape($data['shipping_method']) . "', shipping_code = '" . $this->db->escape($data['shipping_code']) . "', comment = '" . $this->db->escape($data['comment']) . "', total = '" . (float)$data['total'] . "', affiliate_id = '" . (int)$data['affiliate_id'] . "', commission = '" . (float)$data['commission'] . "', language_id = '" . (int)$data['language_id'] . "', currency_id = '" . (int)$data['currency_id'] . "', currency_code = '" . $this->db->escape($data['currency_code']) . "', currency_value = '" . (float)$data['currency_value'] . "', ip = '" . $this->db->escape($data['ip']) . "', forwarded_ip = '" .  $this->db->escape($data['forwarded_ip']) . "', user_agent = '" . $this->db->escape($data['user_agent']) . "', accept_language = '" . $this->db->escape($data['accept_language']) . "', date_added = NOW(), date_modified = NOW()");
    
      $order_id = $this->db->getLastId();
    
      foreach ($data['products'] as $product) { 
       $this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name = '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product['model']) . "', quantity = '" . (int)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'");
     
       $order_product_id = $this->db->getLastId();
    
       foreach ($product['option'] as $option) {
        $this->db->query("INSERT INTO " . DB_PREFIX . "order_option SET order_id = '" . (int)$order_id . "', order_product_id = '" . (int)$order_product_id . "', product_option_id = '" . (int)$option['product_option_id'] . "', product_option_value_id = '" . (int)$option['product_option_value_id'] . "', name = '" . $this->db->escape($option['name']) . "', `value` = '" . $this->db->escape($option['value']) . "', `type` = '" . $this->db->escape($option['type']) . "'");
       }
        
       foreach ($product['download'] as $download) {
        $this->db->query("INSERT INTO " . DB_PREFIX . "order_download SET order_id = '" . (int)$order_id . "', order_product_id = '" . (int)$order_product_id . "', name = '" . $this->db->escape($download['name']) . "', filename = '" . $this->db->escape($download['filename']) . "', mask = '" . $this->db->escape($download['mask']) . "', remaining = '" . (int)($download['remaining'] * $product['quantity']) . "'");
       } 
      }

    И это известный движок интернет-магазина OpenCart???
    \catalog\model\checkout\order.php

    govnokoder2, 16 Октября 2014

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

    +137

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public new String StartTime { get { return base.StartTime.ToString("H:mm"); } }
    
    public new String EndTime { get { return base.EndTime.ToString("H:mm"); } }
    
    public DateTime base_StartTime { get { return base.StartTime; } }
    
    public DateTime base_EndTime { get { return base.EndTime; } }

    kjuby8709gsome, 10 Октября 2014

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

    +133

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    /**
    	 * return angle of otrezok near the center, with circle point as a second part of the otrezok
    	 * 
    	 * @param center
    	 * @param circlePoint
    	 * @param len
    	 * @return
    	 */

    someone, 09 Октября 2014

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