- 1
if (($rtw['noavt']==1) OR ($rtw['noavt']==1)) {$rtw['noavt']=0;}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+138.5
if (($rtw['noavt']==1) OR ($rtw['noavt']==1)) {$rtw['noavt']=0;}
+142.3
$my_cgi = $_SERVER['REQUEST_METHOD'] == 'GET' ? $_GET : $_POST;
$fnumber = "";
$fname="";
$fjunction = "";
$fstreet = "";
$fintersectingstreet = "";
$flocality = "";
$fadministrative = "";
$fpostalcode = "";
$fsettlement = "";
$flatitude = 0.0;
$flongitude = 0.0;
$fcoordtype = "";
$ffreetext = "";
$fuid = "";
$fsettlement = "";
$tnumber = "";
$tname="";
$tjunction = "";
$tstreet = "";
$tintersectingstreet = "";
$tstreet = "";
$tlocality = "";
$tadministrative = "";
$tpostalcode = "";
$tsettlement = "";
$tlatitude = 0.0;
$tlongitude = 0.0;
$tcoordtype = "";
$tfreetext = "";
$tuid = "";
$method = "";
$passenger = "";
$return = "";
$trainf = "";
$traind = "";
$flocate = "";
$tlocate = "";
/*****************************************************************************
* Decode URL
****************************************************************************/
while (list($my_key, $my_value) = each($my_cgi)) {
if($my_key == "fname") {
$fname = $my_value;
} else if ($my_key == "fnumber" ) {
$fnumber = $my_value;
} else if($my_key == "fstreet") {
$fstreet = $my_value;
} else if($my_key == "fintersectingstreet") {
$fintersectingstreet = $my_value;
} else if($my_key == "flocality") {
$flocality = $my_value;
} else if($my_key == "fadministrative") {
$fadministrative = $my_value;
} else if ($my_key == "fpostalcode") {
if ($my_key["fpostalcode"] != "") {
$fpostalcode = $my_value;
}
} else if ($my_key == "fsettlement" ) {
$fsettlement = $my_value;
} else if ($my_key == "flatitude" ) {
$flatitude = $my_value;
} else if ($my_key == "flongitude" ) {
$flongitude = $my_value;
} else if ($my_key == "fcoordtype" ) {
$fcoordtype = $my_value;
} else if ($my_key == "fmatch_uid" ) {
$fuid = $my_value;
} else if ($my_key == "ffreetext" ) {
$ffreetext = $my_value;
} else if($my_key == "tname") {
$tname = $my_value;
} else if ($my_key == "tnumber" ) {
$tnumber = $my_value;
} else if($my_key == "tstreet") {
$tstreet = $my_value;
} else if($my_key == "tintersectingstreet") {
$tintersectingstreet = $my_value;
} else if($my_key == "tlocality") {
$tlocality = $my_value;
} else if($my_key == "tadministrative") {
$tadministrative = $my_value;
} else if ($my_key == "tpostalcode") {
if ($my_key["tpostalcode"] != "") {
$tpostalcode = $my_value;
}
} else if ($my_key == "tsettlement" ) {
$tsettlement = $my_value;
} else if ($my_key == "tnumber" ) {
$tnumber = $my_value;
} else if ($my_key == "tlatitude" ) {
$tlatitude = $my_value;
} else if ($my_key == "tlongitude" ) {
$tlongitude = $my_value;
} else if ($my_key == "tcoordtype" ) {
$tcoordtype = $my_value;
} else if ($my_key == "tmatch_uid" ) {
$tuid = $my_value;
+66.8
switch ($iType) {
case 0:
$iType = 0;
/* code */
break;
case 1:
$iType = 1;
/* code */
break;
}
Так как весь switch тянется на 1000 строк то приважу краткий вид.
−98
if (!EventManager.getInstance().hasEventListener("START_NEW_LEVEL")) EventManager.getInstance().addEventListener("START_NEW_LEVEL", preCreateLevel);
−857.4
select *
from INV_CARD
where to_char (dt_reg, 'MM') < TO_CHAR(SYSDATE, 'MM')
AND (DT_OUT IS NULL OR to_char (dt_OUT, 'MM') = TO_CHAR(SYSDATE, 'MM'))
AND ID_FA_TYPE NOT IN (SELECT ID_FA_TYPE FROM FA_TYPE WHERE CODE = '17')
AND ID_FA_STATUS IN (SELECT ID_FA_STATUS FROM FA.V_FA_STATUS WHERE IS_ACCOUNTING = 1)
AND STATUS = 1
AND GLN.ACC_OPER.GET_ACC1_ACC2(ID_AMORT_ACC) LIKE '01%'
(PL/SQL)
очень понравилось сравнение дат, ну и использование констант тоже зачет
+153
$this->template_vars['product_description'] = nl2br(str_replace('{price}', (($this->template_vars['product_old_price']) ? '<span class="old_price">$'.$this->template_vars['product_old_price'].'</span> ' : '').'$'.$this->template_vars['product_price'], $this->template_vars['product_description'])) . $fabric;
Это не столько говнокод, сколько пример непреднамеренной обфускации.
−334.1
if (scrollBar != null && scrollBar != null) {
.....
}
Случайно нашел у себя в коде. Видать, после рефактора.
"Я хочу быть твердо уверен!"
+153
if (filter.getName() == null) {
navigator.setModifierName(filter.getName());
} else {
navigator.setModifierName(filter.getName());
}
+143.3
if (PEAR::isError($iNameID)) if (PEAR::isError($iNameID))
{ {
trigger_error($iNameID->getMessage()); trigger_error($iNameID->getMessage());
} }
−285.8
public function check():void {
var gem:Gem;
var counter:Number = 1;
for (var i : int = 0; i < _cols; i++) {
gem = null;
counter = 1;
for (var j : int = 0; j < _rows; j++) {
checkCell();
}
}
for (var j : int = 0; j < _rows; j++) {
gem = null;
counter = 1;
for (var i : int = 0; i < _cols; i++) {
checkCell();
}
}
function checkCell():void {
if (getCell(i,j).gem == gem) {
counter++;
} else {
if (counter>=GEMS_IN_ROW) {
checkLine(i, j-counter, i, j-1);
}
gem = getCell(i,j).gem;
counter = 1;
}
}
deleteCells();
}
private function checkLine(startX:Number, startY:Number, endX:Number, endY:Number):void {
if (startX == endX) {
for (var j : int = startY; j < endY; j++) {
_cells[startY][j].toDelete = true;
}
} else {
for (var i : int = startX; i < endX; i++) {
_cells[i][startY].toDelete = true;
}
}
}
знакомый осваивает программирование на флэше
жжот не по детски