- 1
- 2
- 3
if ((getProductId() != null) && (getProductId().equals(new String("5")))) {
//do it
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+75
if ((getProductId() != null) && (getProductId().equals(new String("5")))) {
//do it
}
ProductId читается один раз при старте приложения, а таких проверок около 50-и.
+153
// Является ли это говнокодом?
<form action="prog.php?a=1&b=2" method="POST">
...
Говнокод или так можно делать?
+106
proxy1.GetMeasurements(
new AccountingMeasurementType(255, "Тип документа")))
.ToList()
.FirstOrDefault(item =>
item.Name.Equals("Спецификация")
),
SpecificationDS.DateFrom as DateTime?,
SpecificationDS.DateTo as DateTime?)
);
Мало того что в коде прошита сразу куча строк, так еще и числовая константа %)
+141
for (int x=0; x < TANK_SIZE; x++)
{
for (int y=0; y < TANK_SIZE; y++)
{
*((Uint32 *)(((Uint8 *)player_surface[DOWN]->pixels) + (TANK_SIZE - y - 1) * player_surface[DOWN]->pitch + (TANK_SIZE - x - 1) * player_surface[DOWN]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)player_surface[LEFT]->pixels) + (TANK_SIZE - x - 1) * player_surface[LEFT]->pitch + y * player_surface[LEFT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)player_surface[RIGHT]->pixels) + x * player_surface[RIGHT]->pitch + (TANK_SIZE - y - 1) * player_surface[RIGHT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)player_surface[UP]->pixels) + y * player_surface[UP]->pitch + x * player_surface[UP]->format->BytesPerPixel));
*((Uint32 *)(((Uint8 *)enemy_surface[DOWN]->pixels) + (TANK_SIZE - y - 1) * enemy_surface[DOWN]->pitch + (TANK_SIZE - x - 1) * enemy_surface[DOWN]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)enemy_surface[LEFT]->pixels) + (TANK_SIZE - x - 1) * enemy_surface[LEFT]->pitch + y * enemy_surface[LEFT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)enemy_surface[RIGHT]->pixels) + x * enemy_surface[RIGHT]->pitch + (TANK_SIZE - y - 1) * enemy_surface[RIGHT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)enemy_surface[UP]->pixels) + y * enemy_surface[UP]->pitch + x * enemy_surface[UP]->format->BytesPerPixel));
}
}
+130
#if defined (CAMCORDER_FEATURE_SUPPORT_VIEW_MODE)
// case SETTING_VIEW_MODE:
#endif
+136
if(TouchRegist && !gIsCleanView && !gChangeZoom &&!gChangeBrightness)
if( TouchRegist && gChangeZoom)
{
...
}
break;
+1003
// укорочено для краткости.
void ATraceClass::LogFunction(const char *format, va_list ap)
{
/* ... declarations ... */
for (p=format; (*p)&&(!isTruncated); p++)
{
if ( * p == '%' )
switch( * ++p )
{
case 'c':
{ /* ... */ }
break;
case 'd':
case 'i':
{ /* ... */ }
break;
case 'l': // это %ld
{ /* ... */ }
break;
case 'L': // это %Ld
{ /* ... */ }
break;
case 'f': // a это %g
{ /* ... */ }
break;
case 'F': // a это %Lg
{ /* ... */ }
break;
case 's':
{ /* ... */ }
break;
default: // this is an ERROR case, but we will not perform coding at this point ... maybe later
break;
}
else {
/* ... */
}
}
}
наболело. одно чудило (с большой букмы Му) наговнокодило это дело под эгидой "stdio это С, мы в С++ можем круче!!!" ну с тех пор и переизобретают велосипед - с квадратными колёсами. даже %% не догадались сделать.
уже как года два давлю вот это Г, но наши немецкие умельцы копи-пастят это в новые модуля быстрее чем я успеваю это удалять.
самое гадкое что народ пишет код как обычно ожидая стандартные stdio шорткаты, и потом долго гадает куда блин сообщение подевалось.
+135
/* TODO: make this into something smarter than a linked list */
typedef struct bunchOfInstances_t {
ncInstance * instance;
int count; /* only valid on first node */
struct bunchOfInstances_t * next;
} bunchOfInstances;
ncInstance * get_instance (bunchOfInstances **headp)
{
static bunchOfInstances * current = NULL;
/* advance static variable, wrapping to head if at the end */
if ( current == NULL ) current = * headp;
else current = current->next;
/* return the new value, if any */
if ( current == NULL ) return NULL;
else return current->instance;
}
+166
if($posting == 0) {
if(!isset($posting) && count($fld)) {
Всё та же NetCat 3.6.
+144
public bool Inverse(bool value){
if(value.ToString().Length == 4)
return false;
else return true;
}
было дело...