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

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

    +116

    1. 1
    2. 2
    var result = resultDate.ToString("yyyy-MM-dd");
    result = result.Replace("-", "");

    zonder, 04 Августа 2010

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

    +146

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    $module=(!empty($_GET['mod']))?$_GET['mod']:"static";
    
    if(is_file("modules/".$module.".class.php"))
    {
        include_once("modules/".$module.".class.php");
    }
    else
    {
        include_once("modules/error.class.php");
    }

    от такая хитрожопая система, позволяющая подгружать "модули"

    zloiia, 04 Августа 2010

    Комментарии (8)
  4. JavaScript / Говнокод #3867

    +168

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    var count = response.data.length;
    var all_count = count;
    if(all_count > count) {
        count = all_count - count;
    }

    Уличная магия. О_о (Мапед не мой)

    Alex_Slubsky, 04 Августа 2010

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

    +157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function writemsg(msg, colors)
    {
    	length = msg.length;
    	i=0;
    	while(i<length)
    	{
    		document.getElementById("msgbox").innerHTML = document.getElementById("msgbox").innerHTML + "<br><font color="+colors[i]+">"+msg[i]+"</font>";
    		i=i+1; //z
    	}
    	return true;
    }

    XyHb, 31 Июля 2010

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

    +169

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    public function Add()
    {
    $db->query ('DELETE FROM ' . $this->_table . ' WHERE clientId=' . $this->clientId . ' AND memberId=' . $this->userId);
    $db->query ('INSERT INTO ' . $this->_table . ' SET clientId=' . $this->clientId . ', memberId=' . $this->userId);
    return true;
    }

    без комментариев

    rtfm, 28 Июля 2010

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

    +147

    1. 1
    2. 2
    3. 3
    if(@$_GET['modul']=="logout"){
        //code
    }

    ленивый мудак

    sogekoder, 19 Июля 2010

    Комментарии (8)
  8. JavaScript / Говнокод #3722

    +159

    1. 1
    Boolean.prototype.toLocaleString = function () { return this; return this ? 'Yes' : 'No' }

    пукнул...

    bugmenot, 16 Июля 2010

    Комментарии (8)
  9. JavaScript / Говнокод #3720

    +158

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Object.prototype.addEvent = function (type, handler) {
    	for (var i = 0; i < this.length; i++) {
    		this[i]['on' + type] += ';' + (handler + '').replace(/function.+?\{/, '').replace(/}$/, '');
    	}
    	return this;
    };

    eval, 16 Июля 2010

    Комментарии (8)
  10. Куча / Говнокод #3696

    +129

    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
    Author: decker <decker@personal-army>  2010-06-19 05:39:42
    Committer: decker <decker@personal-army>  2010-06-19 05:39:42
    
        fix potential race in reservation id generation
    
    @@ -97,7 +98,7 @@ public class VmInstances extends AbstractNamedRegistry<VmInstance> {
         do {
           MessageDigest digest = Hashes.Digest.MD5.get();
           digest.reset();
    -      digest.update( Long.toString( rsvId + launchIndex + System.currentTimeMillis() ).getBytes() );
    +      digest.update( Long.toString( rsvId + launchIndex + System.nanoTime( ) ).getBytes() );
     
           Adler32 hash = new Adler32();
           hash.reset();

    Вот так суровые калифорнийцы сурово чинят race...

    raorn, 13 Июля 2010

    Комментарии (8)
  11. Ruby / Говнокод #3675

    −92

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if html_content.product_id == 11 || html_content.product_id == 8 || html_content.product_id == 15 || html_content.product_id == 20 
      @terms_and_conditions = Page.find(212).contents
    else 
      @terms_and_conditions = Page.find(213).contents  
    end

    paveldruzyak, 09 Июля 2010

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