- 1
$obj = new Task(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1010
$obj = new Task(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Когда аргументов не осталось :(
P.S: Когда конструктор хочет слишком многого (нужно установить всего одно свойство - извещение об ошибке).
+999
if (empty($params['sId']))
{
if (empty($params['sId-text']))
{
throw new LogicException('Да быть такого не может, там же required');
}
else
{
$sm = new Some_Model;
$params['sId'] = $sm->insert($params['sId-text']);
}
}
+5
if($row198['verein_id']==$row511['verein_1'])
{
$row198['neu_tore']=$row198['last_tore']+$row511['tore_1'];
$row198['neu_gegentore']=$row198['last_gegentore']+$row511['tore_2'];
$row198['neu_tordiff']=$row198['neu_tore']-$row198['neu_gegentore'];
$row198['neu_siege']=$row198['last_siege']+($row511['tore_1']>$row511['tore_2']);
$row198['neu_niederlagen']=$row198['last_niederlagen']+($row511['tore_1']<$row511['tore_2']);
$row198['neu_unentschieden']=$row198['last_unentschieden']+($row511['tore_1']==$row511['tore_2']);
$row198['neu_spiele']=$row198['last_spiele']+1;
$row198['last_punkte']=$row198['last_siege']*3+$row198['last_unentschieden']*1;
$row198['neu_punkte']=$row198['neu_siege']*3+$row198['neu_unentschieden']*1;
}
else if($row198['verein_id']==$row511['verein_2'])
{
$row198['neu_tore']=$row198['last_tore']+$row511['tore_2'];
$row198['neu_gegentore']=$row198['last_gegentore']+$row511['tore_1'];
$row198['neu_tordiff']=$row198['neu_tore']-$row198['neu_gegentore'];
$row198['neu_siege']=$row198['last_siege']+($row511['tore_1']<$row511['tore_2']);
$row198['neu_niederlagen']=$row198['last_niederlagen']+($row511['tore_1']>$row511['tore_2']);
$row198['neu_unentschieden']=$row198['last_unentschieden']+($row511['tore_1']==$row511['tore_2']);
$row198['neu_spiele']=$row198['last_spiele']+1;
$row198['last_punkte']=$row198['last_siege']*3+$row198['last_unentschieden']*1;
$row198['neu_punkte']=$row198['neu_siege']*3+$row198['neu_unentschieden']*1;
}
через 5 минут заметил разницу.
+3
if ($w>$n) {
print round(100/($w/$n))
} else if ($n>$w) {
print round(100/($n/$w))
}
процентное соотношение между $w и $n
+1001
if ($captcha_url != '' && 1 == 1) {
//echo $html;
require('antigate.php');
Интересно, зачем потребовалось единицы сравнивать
+141
switch($op){
case 'main': IndexNewszMain();
break;
// ......
case 'savepost':
if(CommentsEditPostSave(SafeEnv($_GET['newsz'], 11, int), 'newsz_comments')){
break;
}
// .....
// //
default: IndexNewszMain();
}
Роутинг из модуля одной русской CMS
+143
$style = "{ width: 100%; ";
if ($count % 2 == 0) {
$style .= 'background: lightgrey;';
}
$style .= "}";
+144
if ( (($i%3) == 0) || ($i==$cnt) ) { // $i mod 3
if ($i == 6) {
Без комментариев.
+145
if ($test_domain->num_rows or true )
Обычная проверка на количество строк в запросе... Видимо, не всегда попадало в условие, и автор решил добавить or)
+142
<?php
public
function filter()
{
$manufacturers = Manufacturers::all();
$products = Products::where('category', '=', Input::get('category'))->get();
if (Input::get('size') != 'notselected')
{
$size = Input::get('size');
}
if (Input::get('category') == 3)
{
if (Input::get('type') != 'notselected')
{
$products = Products::where('category', '=', Input::get('category'))->where('type', '=', Input::get('type'))->get();
}
}
if (Input::get('manufacturer') != "notselected")
{
$products = Products::where('category', '=', Input::get('category'))->where('manufacturer', '=', Input::get('manufacturer'))->get();
}
if (Input::get('min') != 0 and Input::get('max') != 0)
{
$products = Products::where('category', '=', Input::get('category'))->whereBetween('price', array(
Input::get('min') ,
Input::get('max')
))->get();
if (Input::get('size') != "notselected")
{
$products = Products::where('category', '=', Input::get('category'))->where('size', 'LIKE', "%$size%")->whereBetween('price', array(
Input::get('min') ,
Input::get('max')
))->get();
}
else
{
$products = Products::where('category', '=', Input::get('category'))->whereBetween('price', array(
Input::get('min') ,
Input::get('max')
))->get();
}
if (Input::get('manufacturer') != "notselected")
{
$products = Products::where('category', '=', Input::get('category'))->where('manufacturer', '=', Input::get('manufacturer'))->whereBetween('price', array(
Input::get('min') ,
Input::get('max')
))->get();
}
else
{
$products = Products::where('category', '=', Input::get('category'))->whereBetween('price', array(
Input::get('min') ,
Input::get('max')
))->get();
}
}
if (Input::get('minim') != 0)
{
$products = Products::where('category', '=', Input::get('category'))->where('price', '<', Input::get('minim'))->get();
if (Input::get('size') != "notselected")
{
$products = Products::where('category', '=', Input::get('category'))->where('size', 'LIKE', "%$size%")->where('price', '<', Input::get('minim'))->get();
}
else
{
$products = Products::where('category', '=', Input::get('category'))->where('price', '<', Input::get('minim'))->get();
}
if (Input::get('manufacturer') != "notselected")
{
$products = Products::where('category', '=', Input::get('category'))->where('manufacturer', '=', Input::get('manufacturer'))->where('price', '<', Input::get('minim'))->get();
}
else
{
$products = Products::where('category', '=', Input::get('category'))->where('price', '<', Input::get('minim'))->get();
}
}
if (Input::get('maxim') != 0)
{
$products = Products::where('category', '=', Input::get('category'))->where('price', '>', Input::get('maxim'))->get();
if (Input::get('size') != "notselected")
{
$products = Products::where('category', '=', Input::get('category'))->where('size', 'LIKE', "%$size%")->where('price', '>', Input::get('maxim'))->get();
}
else
{
$products = Products::where('category', '=', Input::get('category'))->where('price', '>', Input::get('maxim'))->get();
}
if (Input::get('manufacturer') != "notselected")
{
$products = Products::where('category', '=', Input::get('category'))->where('manufacturer', '=', Input::get('manufacturer'))->where('price', '>', Input::get('maxim'))->get();
}
Вот так был реализован фильтр интернет-магазина. Не ну а хули?