- 1
- 2
- 3
- 4
getBtnContent().setEnabled(enable);
if (getGridConfig().isContentEnabled()) {
getBtnContent().setEnabled(enable);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+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;
+30
$files = file_scan_directory(dirname(__FILE__) .'/modes/', '^([^\.].*)\.inc$', array('.', '..', 'CVS'), 0, FALSE);
foreach ($files as $file) {
require_once($file->filename);
$mode = $file->name;
if (function_exists('advpoll_info_'. $mode)) {
$advpoll_modes[$mode] = call_user_func('advpoll_info_'. $mode);
}
}
+150
foreach( $vote->get() as $i => $variant )
{
. . .
$vote = +@$variant[ 'value' ];
. . .
}
Чтобы наверняка!