- 1
const_cast<TRefalAbstract*>(this)=new TRefal();
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+171
const_cast<TRefalAbstract*>(this)=new TRefal();
+162
<script type="text/javascript">
............................
var titlePubOk = "<?php echo 'Показано'; ?>";
var titlePubNo = "<?php echo 'Скрыто'; ?>";
............................
</script>
Вот обновляю систему и вдруг обнаружил собственный, самый натуральный говнокод. Это - невероятно!
+128
public string GetUserCurrentStage(int stage)
{
string stageName = "";
if (stage == 1)
stageName += "Initial Certification";
else if (stage == 2)
{
stageName += "Maintenance *";
}
else if (stage == 3)
stageName += "Recertification";
else
return string.Empty;
return stageName;
}
Когда платят за строчки кода...
+159
$this->addException(Mage::helper('dataflow')->__('Found %d rows.', $this->_countRows));
$this->addException(Mage::helper('dataflow')->__('Starting %s :: %s', $adapterName, $adapterMethod));
$batchModel->setParams($this->getVars())
->setAdapter($adapterName)
->save();
// $adapter->$adapterMethod();
return $this;
$dom = new DOMDocument();
// $dom->loadXML($this->getData());
if (Mage::app()->getRequest()->getParam('files')) {
$path = Mage::app()->getConfig()->getTempVarDir().'/import/';
$file = $path.urldecode(Mage::app()->getRequest()->getParam('files'));
if (file_exists($file)) {
$dom->load($file);
}
} else {
$this->validateDataString();
$dom->loadXML($this->getData());
}
Magento 1.5 stable. после return'a идёт около 70 строк... Насладиться можно тут http://svn.magentocommerce.com/source/branches/1.5/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php
+158
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php echo $this->getChildHtml('form_before') ?>
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
<fieldset>
<table id="shopping-cart-table" class="data-table cart-table">
<col width="1" />
<col />
<col width="1" />
<?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
<col width="1" />
<?php endif ?>
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<col width="1" />
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<col width="1" />
<?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
Ну так, для уверенности, можно и 4 раза. Искал в этом смысл - смысла не найдено. Copyright (c) 2011 Magento Inc.
+158
private function exportPTCsvFile(array $transactions, array $refunds, $fileName)
{
$csv[] = array('Date', 'Time Zone', 'Name', 'Type', ' Status', 'Currency', 'Gross', 'Fee', 'Net', 'From Email Address', 'Transaction ID', ' Item Title', 'Deal ID', 'Deal City', 'Merchant ID', 'User ID', 'Purchase Date', 'CMS Transaction ID', 'CMS Quantity', 'CMS Amount', 'Kash Used', 'CC Digits', 'Coupon Link', 'Paymentech Response');
// headers...
foreach ($csv as $titles) {
print utf8_encode(implode(',', $titles))."\n";
}
// Rest of code...
}
+123
this.Border1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(111)))), ((int)(((byte)(111)))), ((int)(((byte)(111)))));
Встретилось такое внутри сгенеренной системой InitializeComponent()
+83
public void fillFilialNames(ArrayList<String> filialNames) {
for (String filialDTO : filialNames) {
if (!filialNames.isEmpty())
filialNames.add(filialDTO);
}
}
Бесконечный цикл :)
+159
function doXmlEscape($val) {
return str_replace(array('&', '<', '>', '"', "'"), array('&', '<', '>', '"', '''), $val);
}
http://vkontakte.ru/developers.php?o=-1&p=%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80 +%D0%BE%D0%B1%D1%80%D0%B0%D0%B1%D0%BE%D1 %82%D1%87%D0%B8%D0%BA%D0%B0+%D1%83%D0%B2 %D0%B5%D0%B4%D0%BE%D0%BC%D0%BB%D0%B5%D0% BD%D0%B8%D0%B9+%D0%BD%D0%B0+%D1%8F%D0%B7 %D1%8B%D0%BA%D0%B5+PHP
Ох и разработчики... T_T
−111
NetworkStatus internet = [internetReachable currentReachabilityStatus];
switch (internet)
{
case NotReachable: { internetStatus = NO; break; }
case ReachableViaWiFi: { internetStatus = YES; break; }
case ReachableViaWWAN: { internetStatus = YES; break; }
default: break;
}
NetworkStatus host = [hostReachable currentReachabilityStatus];
switch (host)
{
case NotReachable: { hostStatus = NO; break; }
case ReachableViaWiFi: { hostStatus = YES; break; }
case ReachableViaWWAN: { hostStatus = YES; break; }
default: break;
}
//-------------------------------------------------------------
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return false;
}
//-------------------------------------------------------------
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
if (logicRotate == 1)
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) // если ЛандскейпРайт
{
FlowCover.transform = CGAffineTransformIdentity;
indexLandscape = 1;
}
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) // если ЛандскейпЛефт
{
FlowCover.transform = CGAffineTransformMakeRotation(M_PI);
indexLandscape = 0;
}
}
else
{
if (indexLandscape == 1)
{
FlowCover.transform = CGAffineTransformIdentity;
}
else
{
FlowCover.transform = CGAffineTransformMakeRotation(M_PI);
}
logicRotate = 1;
}
return false;
}
//-------------------------------------------------------------
pagetextLabel.hidden = (pageFullScreen.realPageNo) ? NO : YES;
//-------------------------------------------------------------
[(FastImageView*)page showImage:[listOfImages objectAtIndex:pageIndex]]; //картинка
//-------------------------------------------------------------
if (firstPages>2) {
...
if (theAudio) {
[theAudio play]; //звук
}
firstPages++;
}
else
{
firstPages++;
}
//-------------------------------------------------------------
LabPercent.text = [NSString stringWithFormat:@"%d%@", percent * 100, @"%"];
//-------------------------------------------------------------
if ([DELEGATE isIPad]) {
mTempSize = [tempstr sizeWithFont:[UIFont fontWithName:@"Helvetica" size:17.0f] constrainedToSize:maxSize lineBreakMode:UILineBreakModeTailTruncation];
}
else {
mTempSize = [tempstr sizeWithFont:[UIFont fontWithName:@"Helvetica" size:12.0f] constrainedToSize:maxSize lineBreakMode:UILineBreakModeTailTruncation];
}
h = mTempSize.height;
if ([DELEGATE isIPad]) {
lab.font = [UIFont fontWithName:@"Helvetica" size:17.0f];
}
else {
lab.font = [UIFont fontWithName:@"Helvetica" size:12.0f];
}
От того же автора http://govnokod.ru/6964. Тут избранные куски, хотя можно постить весь проект