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

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

    +73.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
    public void execute(String _filein, String _fileout) throws IOException {
            File fin = new File(_filein);
            File fout = new File(_fileout);
            FileWriter fwout = new FileWriter(fout);
            int chars_read = 0;
            FileReader in = new FileReader(fin);
            int size = (int) fin.length();
            char[] data = new char[size];
            while (in.ready()) {
                chars_read += in.read(data, chars_read, size - chars_read);
            }
            in.close();
            fwout.write(new String(data, 0, chars_read));
            fwout.close();
        }

    как копируют xml'и суровые фсб'шники...

    guest, 06 Мая 2009

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

    +144

    1. 1
    array_walk($array, create_function('&$v, $k, $self', 'if (is_integer($k)) { $self->Add($v); } else { $self->AddAs($k, $v); }'), $this);

    Это же какой-то пиздец... Вместо нормального цикла наговнокодить такое, во всем проекте так.

    guest, 05 Мая 2009

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

    +143.2

    1. 1
    2. 2
    3. 3
    $_admins = new UpdaterAdmins($_dbh, $_dbs, $_cfg['dbh_botid'], $_cfg['dbh_type'] == 'sqlite3' ? false : true, $_cfg['dbs_mysql_max_inserts']);
    $_admins->update();
    $_admins = null; unset ($_admins);

    чтоб наверняка

    guest, 05 Мая 2009

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

    +148.7

    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
    do
    {
    	if ( isset( $_SERVER['HTTP_REFERER'] ) )
    	{
    		if ( stripos_clone( $_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'] ) )
    		{
    			break;
    		}
    		else
    		{
    		}
    	}
    	else
    	{
    		exit( $posttags );
    	}
    } while ( 0 );

    Мы не ищем легких путей...

    guest, 04 Мая 2009

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

    +143

    1. 1
    ''''''''''''''''''''">LK""":;''''''''''''''''''''''''''">LK""":;''''''

    ''''''''''''''''''''">LK""":;''''''

    guest, 02 Мая 2009

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

    −96

    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
    class SomeServer:
        def __init__(self, ...)
            self.__dispatcher = {"CMD1" : self.invoke_cmd1_command, \
                                 "CMD2" : self.invoke_cmd2_command, \
                                 "CMD3" : self.invoke_cmd3_command, \
                                 "CMD4" : self.invoke_cmd4_command, \
                                  ... : ...}
    
    
        def handle_some_request(self, request):
            command, arguments = extract_command_and_arguments(request)
            try:
                self.__dispatcher[command](command, arguments)
            except Exception as e:
                ... log it ...
                ... return error to client...
                ... whatever ...

    Комментарии излишни

    guest, 01 Мая 2009

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

    +153

    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
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    function showFormEdit($id="",$sMsg="", $p_iPageIndex="")
    	{
    		global $oGlobal;
    		eval( $oGlobal->getGlobalVars() );
    		$oGlobal->importUserClass( "rubik.CMoneyOXConfig");
    		RImporter::importRubikClass("ext.xpbox.RHtmlImageUploadForm");
    		RImporter::importRubikClass("ext.xpbox.RHtmlUploadForm");
    		RImporter::importRubikClass("ext.xpbox.RDbComboboxHtml");
    		$oGlobal->importUserClass("rubik.CRubikHelper");
    		$oModel = $this->m_oModel;
    		$dirHelper= CMoneyOXConfig::getInstance();
    		$sBlast = "Manage Download";
    		$assetPath	=	ASSET_PATH;
    		$helper = new CRubikHelper();
    		$x_title				= htmlentities( @$_POST['x_title'], ENT_QUOTES );
    		$x_type					= @$_POST['x_type'];
    		$x_status				= @$_POST['x_status'];
    		$x_date 				= @$_POST['x_date'];
    		if(!empty($id))
    		{
    			$result = $oModel->getDownloadbyID($id);
    			$record = $result->recordSet;
    			$row = $record[0];
    			$sBlast = "Edit Download";
    			$title = $row['title'];
    			$date= date("Y-m-d ",strtotime($row['date']));
    			if($row['publish']) $sYes= " checked=\"true\"";
    			else $sNo= " checked=\"true\"";
    			//create upload image form
    			$picUpload = new RHtmlImageUploadForm("x_picture",$dirHelper->downloadImageDir,$row['preview_image']);
    			$htmlPicture = $picUpload->createUploadFormHtml(50);
    
    			//create upload file form
    			$fileUpload = new RHtmlUploadForm("x_file",$dirHelper->downloadFileDir,$row['download_image'],".zip,.rar");
    			$htmlFile = $fileUpload->createUploadFormHtml(50);
    
    			//create combobox type
    			$sql = "select id,name from download_setting order by id";
    			$categoryTypeHtml = new RDbComboboxHtml($sql,"id", "name", "type",$row['type']);
    			$cbxType = $categoryTypeHtml->createCombobox();
    
    			$thumb = $helper->getThumbName($row['preview_image'],$dirHelper->downloadThumbDir);
    			$thumb = ABS_PATH.$thumb;
    			$thumb = str_replace("administrator/","",$thumb);
    			$thumbHtml = "<img src=\"{$thumb}\" alt=\"\" class=\"borderimg1\"/><br />
    							<input type=\"checkbox\" name=\"remove\" id=\"x_remove\" value=\"remove\" border=\"0\" /> 
    							Remove Photo";
    
    		}
    			
    		@eval( "\$tpl= \"".getTemplate( "edit.back", COMP_PATH . "templates/back" )."\";" );
    		$sys_sCompContent .= $tpl;
    		return $tpl;
    	}

    Индусы жгут по полной, вот код написанный въетнамцами хех

    14MB в gz, полный ппц, тошнит до сих пор

    guest, 01 Мая 2009

    Комментарии (3)
  9. Java / Говнокод #978

    +152

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    private Integer employeeId;
    
     public Integer getEmployeeId() {
        return employeeId;
     }
    
     public void setEmployeeId(Integer customerId) {
        this.employeeId = customerId;
     }

    Проперти бина, а также его геттер и сеттер. Особенно сеттер.

    guest, 30 Апреля 2009

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

    +144.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <div styleborder:3px solid #000000; 
        height: 300px;
        width: 600px;
        text-align:center;>
            background:url(http://cs4288.vkontakte.ru/u29274663/90187299/x_a74c614b.jpg) no-repeat center;"> 
        
    </div>

    html-опус

    guest, 26 Апреля 2009

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

    +142.3

    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
    //------------------------------Запись в профиль ----------------------------//
    $ufile = file(BASEDIR."local/profil/$log.prof"); 
    $udata = explode(":||:",$ufile[0]);
    
    if($udata[10]>0){
    $udata[10]=0;
    $udata[14]=$ip;
    
    for ($u=0; $u<$config_userprofkey; $u++){
    $utext.=$udata[$u].':||:';}
    
    if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){
    $fp=fopen(BASEDIR."local/profil/$log.prof","a+");  
    flock ($fp,LOCK_EX); 
    ftruncate ($fp,0);                                                              
    fputs($fp,$utext);
    fflush ($fp);
    flock ($fp,LOCK_UN);
    fclose($fp);  
    unset($utext);
    }}

    Из говно cms wap motor

    guest, 25 Апреля 2009

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