- 1
- 2
- 3
- 4
- 5
- 6
- 7
nop
nop
nop
call somelabel
somelabel:
pop si
sub si, 3
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−248
nop
nop
nop
call somelabel
somelabel:
pop si
sub si, 3
ассемблер - источник массы говнокода, классика...
+22.6
var newstr = null;
var lastnewstr = null;
var newclass = null;
var lastclass = null;
var newstr2 = null;
var lastnewstr2 = null;
var newclass2 = null;
var lastclass2 = null;
var newstr3 = null;
var lastnewstr3 = null;
var newclass3 = null;
var lastclass3 = null;
function check(s, i)
{
p1 = document.getElementById("id_1_"+i);
p2 = document.getElementById("id_2_"+i);
if (s!=lastnewstr)
{
newclass2 = p1.className;
newclass3 = p2.className;
newclass = s.className;
s.className="check";
p1.className="viz";
p2.className="viz";
if (lastnewstr!=null)
{
lastnewstr.className=lastclass;
lastnewstr2.className=lastclass2;
lastnewstr3.className=lastclass3;
}
}
lastnewstr = s;
lastnewstr2 = p1;
lastnewstr3 = p2;
lastclass = newclass;
lastclass2 = newclass2;
lastclass3 = newclass3;
}
Убожество которое на одной строке меняет у <tr> стиль и еще у двух элементов...
−32.7
public void updateAmountValues(List<TransactionResultItem> transactionResultItems) {
for (TransactionResultItem transaction : transactionResultItems) {
Account account = getAccountById(transaction.getAccountId());
if ((transaction.getMainTransaction()
&& ! transaction.getTransactionTypeId().equals(4)
&& ! transaction.getTransactionTypeId().equals(5)
&& ! transaction.getTransactionTypeId().equals(6))
||
(! transaction.getMainTransaction() &&
(transaction.getTransactionTypeId().equals(5) &&
((account.getAccountTypeId().equals(AccountType.INCOME_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_INCOME_TYPE_ID)) &&
transaction.getAmount() > 0)
|| (transaction.getAccountId().equals(getSalesTaxPayableAccountId()) && transaction.getAmount() > 0)
|| ((account.getAccountTypeId().equals(AccountType.EXPENSE_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_EXPENSE_TYPE_ID)) && transaction.getAmount() < 0))
|| (transaction.getTransactionTypeId().equals(1) &&
(account.getAccountTypeId().equals(AccountType.INCOME_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_INCOME_TYPE_ID)) &&
transaction.getAmount() < 0)
|| (transaction.getTransactionTypeId().equals(2) &&
(account.getAccountTypeId().equals(AccountType.INCOME_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_INCOME_TYPE_ID)) &&
transaction.getAmount() > 0)
)) {
Double amount = transaction.getAmount();
transaction.setAmount(-amount);
}
}
}
Потрясающий по понятности код. Вызывался несколько раз в одном и том же методе.
−53.2
/**
* Reply string array after tokenize the url address
*
* @param String url
* @return String[]
*/
protected String[] processURL(String url) {
StringBuffer s = new StringBuffer(url);
StringBuffer AfterRemoval = s.delete(0, 27);
...
...в тот день магическим числом для паренька из Индии было число 27... похоже он и сам не понимал почему.. возможно это как то было связано с именем хоста...
−417.7
SELECT FROM Staff
CASE Sex
WHEN 'M' THEN 'МужЫк!'
WHEN 'F' THEN 'Баба'
ELSE 'ЫЫЫыы?'
препод сказал что елсе не будет выполняться изза ограничений целостности базы
−599.6
private function _mouseDown(e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_UP, _mouseUp);
if (e.target is PCell) {
//Клик по клетке, но возможно хотят подвигать поле :)
_startDrag(e);
}
else {
//Значит двигаем поле
_startDrag(e);
}
}
+30
private static string identifier(string wmiClass, string wmiProperty)
{
string result = "";
System.Management.ManagementClass mc =
new System.Management.ManagementClass(wmiClass);
System.Management.ManagementObjectCollection moc = mc.GetInstances();
foreach (System.Management.ManagementObject mo in moc)
{
//Only get the first one
if (result == "")
{
try
{
result = mo[wmiProperty].ToString();
break;
}
catch
{
}
}
}
return result;
}
−43.8
private Map<Class<?>, Map<String, String[]>> compressDependencies(
Map<Class<?>, Map<String, List<String>>> dependencies) {
final Map<Class<?>, Map<String, String[]>> result =
new FastMap<Class<?>, Map<String, String[]>>(dependencies.size());
final Set<Entry<Class<?>, Map<String, List<String>>>> entrySet = dependencies.entrySet();
for (Entry<Class<?>, Map<String, List<String>>> entry : entrySet) {
final Map<String, List<String>> value = entry.getValue();
final Map<String, String[]> desc = new FastMap<String, String[]>(value.size());
final Set<Entry<String, List<String>>> subEntries = value.entrySet();
for (Entry<String, List<String>> valueEntry : subEntries) {
final List<String> list = valueEntry.getValue();
if (list != null && !list.isEmpty()) {
desc.put(valueEntry.getKey(), list.toArray(new String[list.size()]));
}
}
result.put(entry.getKey(), desc);
}
return result;
}
Код от "мега разработчика", архитектора очень большого проекта.
PS Будьте осторожны в использовании java generics :)
+33.5
<script>
function changeLogo(imgLoc){
document.getElementById("module_logo").src = "./site/" + imgLoc + "_logo.jpg";
}
function returnLogo(imgLoc){
document.getElementById("module_logo").src = "./site/" + imgLoc + "_logo.jpg";
}
</script>
+30.6
$cResult = mysql_query($cQuery) or die(mysql_error());
if (mysql_num_rows($cResult) <= 0)
{
if ( $_GET['extra'] == "a" || $_GET['extra'] == 4 || $_GET['extra'] == 16 || $_GET['extra'] == "n" || $_GET['extra'] == "m" || $_GET['extra'] == "m_in_cat" )
{}
else
{
echo CAT_NO_WALP;
}
} else
{
$Row = mysql_fetch_object($cResult);
$id = $Row->id;
if ( $_GET['extra'] == "a" )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == 4 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `four_three` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `four_three` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `four_three` = '1' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == 16 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `sixteen_ten` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `sixteen_ten` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `sixteen_ten` = '1' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == "n" )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `status_NEW` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `status_NEW` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `status_NEW` = '1' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == "m" )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `poster` = '".$_SESSION['userid']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `poster` = '".$_SESSION['userid']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `poster` = '".$_SESSION['userid']."' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == "m_in_cat" )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `poster` = '".$_SESSION['userid']."' AND Category = '".$result_needed['id']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `poster` = '".$_SESSION['userid']."' AND Category = '".$result_needed['id']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `poster` = '".$_SESSION['userid']."' AND Category = '".$result_needed['id']."' ORDER BY `ID` DESC");
}
else
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `Category` = '".$id."' OR `Category` IN (SELECT `id` FROM `Categories` WHERE `Parent` = '".$id."') ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage"); ///-------------
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `Category` = '".$id."' OR `Category` IN (SELECT `id` FROM `Categories` WHERE `Parent` = '".$id."') ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `approved` = '0' AND `Category` = '".$id."' OR `Category` IN (SELECT `id` FROM `Categories` WHERE `Parent` = '".$id."') ORDER BY `ID` DESC");
}
if ( $_GET['extra'] == "a" && $_SESSION['usergroupid'] > 3 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == 4 && $_SESSION['usergroupid'] > 3 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `four_three` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `four_three` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `four_three` = '1' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == 16 && $_SESSION['usergroupid'] > 3 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `sixteen_ten` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `sixteen_ten` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `sixteen_ten` = '1' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == "n" && $_SESSION['usergroupid'] > 3 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `status_NEW` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `status_NEW` = '1' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `status_NEW` = '1' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == "m" && $_SESSION['usergroupid'] > 3 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `poster` = '".$_SESSION['userid']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `poster` = '".$_SESSION['userid']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `poster` = '".$_SESSION['userid']."' ORDER BY `ID` DESC");
}
elseif ( $_GET['extra'] == "m_in_cat" && $_SESSION['usergroupid'] > 3 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `poster` = '".$_SESSION['userid']."' AND Category = '".$result_needed['id']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `poster` = '".$_SESSION['userid']."' AND Category = '".$result_needed['id']."' ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `poster` = '".$_SESSION['userid']."' AND Category = '".$result_needed['id']."' ORDER BY `ID` DESC");
}
elseif ( $_SESSION['usergroupid'] > 3 elseif ( $_SESSION['usergroupid'] > 3 )
{
$result = mysql_query("SELECT * FROM `Wallpapers` WHERE `Category` = '".$id."' OR `Category` IN (SELECT `id` FROM `Categories` WHERE `Parent` = '".$id."') ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage"); ///-------------
$myresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `Category` = '".$id."' OR `Category` IN (SELECT `id` FROM `Categories` WHERE `Parent` = '".$id."') ORDER BY `ID` DESC LIMIT ".$page*$picsperpage.",$picsperpage");
$countresult = mysql_query("SELECT * FROM `Wallpapers` WHERE `Category` = '".$id."' OR `Category` IN (SELECT `id` FROM `Categories` WHERE `Parent` = '".$id."') ORDER BY `ID` DESC");
// И еще примерно столько же подобного говнеца. Сюда просто не влазит...
}
Пустые ифы, куча лишних запросов.
Очень яркий пример ИНДУСтриального программирования.