- 1
- 2
- 3
// this fucking motherfucker is because fucking popup (don't want to remake whole authorisatio system)
if (isset($_SERVER['HTTP_REFERER']) && !preg_match("/\/$/", $_SERVER['HTTP_REFERER']))
$_SERVER['HTTP_REFERER'] .= "/";
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+159
// this fucking motherfucker is because fucking popup (don't want to remake whole authorisatio system)
if (isset($_SERVER['HTTP_REFERER']) && !preg_match("/\/$/", $_SERVER['HTTP_REFERER']))
$_SERVER['HTTP_REFERER'] .= "/";
И блядь по 10 таких кусков кода на 1 файл.
−116
sub addOrUpdateContr {
my $doc = shift;
my( $id ) = $common->dbh->selectrow_array(
qq|SELECT contrid FROM... | );
$id = $id || 0;
if ( $id ) {
# вариант действий 1 ....
return $id;
}
if( !$id ) {
# вариант действий 2 (делает INSERT)....
return $id;
} else {
# вариант действий 3 ....
return $id;
}
return $id;
}
Просто красивая функция.
И то, что при названии addOrUpdateContr никакого апдэйта она не делает в ней далеко не самое замечательное.
+80
getBtnContent().setEnabled(enable);
if (getGridConfig().isContentEnabled()) {
getBtnContent().setEnabled(enable);
}
Программист со стажем, всегда хочет быть уверен что кнопка будет доступна на 150%
+161
...
public function getLocations($fresh = 0)
{
$tld =& $this->varGet('tld');
$domain =& $this->varGet('domain');
// if website is viewed via IP
$noWWWButIP =& $this->varGet('noWWWButIP');
$memCacheKey = 'getLocations';
if (!$fresh) {
// already fetched and stored in vars?
if (is_array($this->varGet('arrLocations')))
$arrLocations = $this->varGet('arrLocations');
// lets try fetching from memcache
else
$arrLocations = kd()->lib('kdCache')->get($memCacheKey);
}
// regenerate
unset($arrLocations);
if (!is_array($arrLocations)) {
...
Кэшируем))
+118
if (mainWareHouseId.HasValue && mainWareHouseId.Value.ToString() == this._locationList.SelectedValue)
{
return false;
}
else
{
return location == null ? true : !location.RegionalFulfillment;
}
−143
1С.................
Когда копро уже не вставляет.
+164
<?php
$_POST=array_merge($_POST,APP_Models_Posts::getKeyDis($_POST,$_POST['post_text'].' '.$_POST['post_name']));
?>
Неговнокод такой неговнокод.
+82
if (srType != null) {
if (srType.equals("my_requests")) {
String str;
String temp = srType.toUpperCase();
int i = srType.indexOf("_");
if (i != -1) {
str = srType;
str.replace('_', ' ');
temp.replace('_', ' ');
str = temp.substring(0, 1) + str.substring(1, i) + " "
+ temp.substring(i + 1, i + 2)
+ str.substring(i + 2, str.length());
} else
str = temp;
criteriaNode.setAttribute("type", str);
criteriaNode.setAttribute("subtype", "currentrequests");
} else {
criteriaNode.setAttribute("type", "My Requests");
criteriaNode.setAttribute("subtype", srType);
}
}
Творение вполне известного (по VCS) сумрачного гения из Индии. Видимо замышлялось что-то неимоверное мощное и универсальное.
+73
String filterDescription = "";
try {
filterDescription = wdContext.currentContextElement().getAttributeValue("table" + Level + "Description" + "filter").toString();
} catch (Exception e) {
// TODO: handle exception
}
wdContext.currentContextElement().getAtt ributeValue("table" + Level + "Description" + "filter") возвращает значение атрибуты из контекста с типом Object. try в данном случае тут добавлен, чтобы не писать лишних проверок, если вернется null, а filterDescription так и остался пустой строкой.
+147
die();
return false;