1. Java / Говнокод #14446

    +76

    1. 1
    2. 2
    3. 3
    public static boolean isNodePresent(String nodeName, String tree, boolean waitForNotNullCondition) {
        return (waitForNotNullCondition) ? getTreeItemId(tree, nodeName) != null : getTreeItemId(tree, nodeName) == null;
    }

    Actine, 30 Января 2014

    Комментарии (9)
  2. PHP / Говнокод #14444

    +142

    1. 1
    2. 2
    3. 3
    4. 4
    public function GetSubscriptions()
    {
            return $this->repaymentPay->check();
    }

    А я сказал горбатый!

    dimkich, 30 Января 2014

    Комментарии (1)
  3. Куча / Говнокод #14443

    +126

    1. 1
    2. 2
    3. 3
    4. 4
    @echo off
    chcp 1251
    mygame.exe
    chcp 866

    Оттуда.

    LispGovno, 30 Января 2014

    Комментарии (36)
  4. Pascal / Говнокод #14442

    +81

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    procedure tmythread.execute;
      procedure fillmemo;
      begin
        form1.memo1.lines.add('Some string');
      end;
    begin
      synchronize(fillmemo); //[Error] Unit1.pas(54): There is no overloaded version of 'Synchronize' that can be called with these arguments
    end;

    Почему нельзя сделать вещи, сделанные "через анус", еще более "через анус"?

    Stertor, 29 Января 2014

    Комментарии (121)
  5. Java / Говнокод #14441

    +74

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    List<CurrentRegion> currentRegionsFromDb = impl
    		.getAll(CurrentRegion.class);
    
    if (currentRegionsFromDb.size() != 1) {
    	throw new FillReportException();
    }
    
    CurrentRegion currentRegion = (CurrentRegion) currentRegionsFromDb
    		.toArray()[0];

    массив головного мозга

    evg_ever, 29 Января 2014

    Комментарии (83)
  6. Java / Говнокод #14440

    +70

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    protected void writeCaptionForDoubleColumns(HSSFWorkbook wb,
    		HSSFSheet sheet, HSSFRow row, HSSFCellStyle fulBorderCalignFont14,
    		Type1 obj1, Type2 obj2,
    		Type3 obj3, Type4 obj4, Type5 obj5,
    		Type6 obj6, Type7 obj7,
    		boolean writeObj6, boolean writeObj5,
    		boolean isHorizontal, String formName, String formNameCode) {
    	writeCaptionForDoubleColumns(wb, sheet, row, fulBorderCalignFont14,
    			obj1, obj2, obj3, obj4, obj5, obj6,
    			obj7, writeObj6, writeObj5, isHorizontal, formName,
    			formNameCode, true, null);
    }
    
    protected void writeCaptionForDoubleColumns(HSSFWorkbook wb,
    		HSSFSheet sheet, HSSFRow row, HSSFCellStyle fulBorderCalignFont14,
    		Type1 obj1, Type2 obj2,
    		Type3 obj3, Type4 obj4, Type5 obj5,
    		Type6 obj6, Type7 obj7,
    		boolean writeObj6, boolean writeObj5,
    		boolean isHorizontal, String formName, String formNameCode,
    		boolean nameFormCaption) {
    	writeCaptionForDoubleColumns(wb, sheet, row, fulBorderCalignFont14,
    			obj1, obj2, obj3, obj4, obj5, obj6,
    			obj7, writeObj6, writeObj5, isHorizontal, formName,
    			formNameCode, nameFormCaption, null);
    }

    описание может быть только матерным

    evg_ever, 29 Января 2014

    Комментарии (41)
  7. C# / Говнокод #14439

    +136

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    public int GetModuleId(int userId)
    {
        return moduleIdGet(userId);
    }
    
    protected int moduleIdGet(int userId)
    {
        int moduleId;
        // calculate moduleId
        // ...
    
        return moduleId;
    }

    Дал открытый доступ, но в то же время как бы сохранил защищённый.

    wissenstein, 29 Января 2014

    Комментарии (66)
  8. Куча / Говнокод #14438

    +120

    1. 1
    2. 2
    3. 3
    4. 4
    removeTSdbTables(con, yesIknowWhatIamDoing=FALSE)
    dropTStable(con, Table, yesIknowWhatIamDoing=FALSE)
    
    The arument yesIknowWhatIamDoing defaults to FALSE and must be set to TRUE or the function will return an error.

    http://www.inside-r.org/packages/cran/TSsql/docs/dropTStable

    someone, 28 Января 2014

    Комментарии (85)
  9. ActionScript / Говнокод #14432

    −121

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    private function taskResizer_resizeFinished(event:ResizerEvent):void {
                var width:int = event.width;
                var height:int = event.height;
                task.changeSize(width, height);
                // Wake up bindings
                var zones:* = zones; // AHAHAHHAHAHA
                this.zones = null;
                this.zones = zones;
                taskResizer.width = width;
                taskResizer.height = height;
            }

    Апдейт биндингов и контрольный выстрел в (шестой) строке.

    maleka, 28 Января 2014

    Комментарии (20)
  10. PHP / Говнокод #14430

    +155

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    try
    {
      return ($image = $this->row->image()->first())
        ? $image->{$this->imageAlias}
        : dummyThumbnail($this->imageAlias)
      ;
    }
    catch(\Exception $e)
    {
      if ($e->getMessage() === 'Method [image] is not defined on the Query class.')
      {
          $val = parent::value();
          return (is_string($val) and \Str::contains($val, 'http://'))
            ? $val
            : $this->row->getImageSrc($this->name, $this->imageAlias)
          ;
      }
    
      throw new \Exception($e->getMessage(), $e->getCode());
    }

    mobileka, 28 Января 2014

    Комментарии (96)