- 1
if ( (is_file($filename) == true) == true)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+59
if ( (is_file($filename) == true) == true)
+157
for (var inc = 0; inc < 100; inc++){
var key = Math.random();
client.set(inc, Math.random(), function(){
client.get(inc, function(val){
console.log(inc);
})
});
}
"Какого хуя мне 100 раз по 100 возвращается?"
Спросил у меня утром знакомый и отправил этот код.
+75
private void executeUiOperation(final UiOperation operation, final Boolean documentReadOnly) {
boolean readOnly = !edit;
if (documentReadOnly != null) {
readOnly |= documentReadOnly;
}
//....
Кручу-верчу запутать хочу...
+74
if (scope.equals("page")) {
beanObject = context.getAttribute(bean);
} else {
if (scope.equals("request")) {
beanObject = context.getRequest().getAttribute(bean);
} else {
if (scope.equals("session")) {
beanObject = context.getSession().getAttribute(bean);
} else {
if (scope.equals("context")) {
beanObject = context.getServletContext().getAttribute(bean);
}
}
}
}
+141
<?php
if(!$this->model_forum->community_once(array('id'=>$community))) {
echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/style/templates/mobile/no_community.tpl');
}
else if(isset($_GET['topic']) && is_numeric($_GET['topic']) && $topic = $this->model_forum->topic_once(array('id'=>(int)$_GET['topic']))) {
$tpl = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/style/templates/mobile/add_response_topic.tpl');
$tpl = str_replace('{topic_id}', (int)$_GET['topic'] ,$tpl);
echo $tpl;
}
else {
$tpl = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/style/templates/mobile/add_topic.tpl');
$tpl = str_replace('{community}',$community, $tpl);
$tpl = str_replace('{topic_date_closing}', '23', $tpl);
echo $tpl;
} ?>
оцените на предмет гавнокода
+67
$this->bgcolor = $bgcolor ? ($bgcolor <= 0xFFFFFF) ? ($bgcolor > 0xFFFFFF) ? 0xFFFFFF : $bgcolor : 0x000000 : 0xFFFFFF;
FFFFFFFFFFFFFFFFFFFFFFF
−30
TTime childStartTime(TDateTime(2006, EJanuary, 8, 14, 0, 0, 0)); // January 9th 2pm
Из примера calexample в symbian sdk.
+66
function sanitizeString($var)
{
trim($var);
strip_tags($var);
htmlspecialchars($var);
stripslashes($var);
mysql_real_escape_string($var);
}
Защита от SQL инъекции - экранирование, http://www.askdev.ru/q/10604
+55
$i = 0;
foreach($_POST['union'] as $key=>$value) {
$i++;
if ($i == 1) {
$fid = $key;
}
if ($i > 1) {
[код поскипан]
}
}
Ну почему не используется if { } else { }?
+132
long id;
try { id = long.Parse(e.Item.Cells[0].Text); }
catch { id = 0; }
Эта жемчужина прекрасно описывает весь говнокод производимый различными группами людей в моей компании.