1. Список говнокодов пользователя ingenuus

    Всего: 14

  2. JavaScript / Говнокод #23434

    +2

    1. 1
    return $('#edit-btn').parent().parent().children().first().html().split('<')[0];

    ingenuus, 19 Октября 2017

    Комментарии (3)
  3. Java / Говнокод #21634

    −16

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public static String getPolicyByProtection(String protection) {
            for (final Map.Entry<String, Protection> entry : getProtectionTable().entrySet()) {
                if (StringUtils.equalsIgnoreCase(protection, entry.getKey())) {
                    return entry.getValue().policy;
                }
            }
            return null;
        }

    ingenuus, 03 Ноября 2016

    Комментарии (0)
  4. Java / Говнокод #20307

    +6

    1. 1
    2. 2
    3. 3
    4. 4
    StringBuilder text = new StringBuilder();
    for (char letter : section.getName().toCharArray()){
        text.append(Character.toUpperCase(letter));
    }

    Вот так мы приводим текст к верхнему регистру

    ingenuus, 01 Июля 2016

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

    +68

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    // setting simple fields that couldn't be null
            if (firstOperDay != null) {
                dto.setFirstClosedDay(firstOperDay);
            } else {
                dto.setFirstClosedDay(null);
            }
            if (lastOperDay != null) {
                dto.setLastClosedDay(lastOperDay);
            } else {
                dto.setLastClosedDay(null);
            }

    ingenuus, 15 Ноября 2013

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

    +70

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    private boolean isVincodeDisabled() {
            if (Long.valueOf(PaymentValidationStatus.vin_code_incorrect.getValue()).equals(paymentDTO.getErrorCode())) {
                return false;
            } else if (paymentDTO.getVincode() == null) {
                return true;
            } else {
                return false;
            }
        }

    ingenuus, 15 Ноября 2013

    Комментарии (0)
  7. SQL / Говнокод #13635

    −168

    1. 1
    2. 2
    3. 3
    4. 4
    SELECT DISTINCT torg.m_org_id FROM m_org torg
    	INNER JOIN r_message_out mo ON mo.m_org_id = torg.m_org_id
    	INNER JOIN m_day od ON mo.m_day_id = decode((od.m_day_id - 1), 0,1,(od.m_day_id - 1))
    ...

    Связь с предыдущим днем в join

    ingenuus, 21 Августа 2013

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

    +68

    1. 1
    2. 2
    3. 3
    if (!(taxOrgsFilter.getTaxOrgs() == null)) {
    ....
    }

    ingenuus, 19 Августа 2013

    Комментарии (15)
  9. Java / Говнокод #11451

    +75

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    private void executeUiOperation(final UiOperation operation, final Boolean documentReadOnly) {
            boolean readOnly = !edit;
            if (documentReadOnly != null) {
                readOnly |= documentReadOnly;
            }
    //....

    Кручу-верчу запутать хочу...

    ingenuus, 20 Июля 2012

    Комментарии (14)
  10. Java / Говнокод #11441

    +74

    1. 1
    2. 2
    3. 3
    //code...
    item.setInUse((map.getnStreamActive().equals("1") ? true : false));
    //...code

    Писал тим лид одного из вендоров проекта.
    nStreamActive - Integer

    ingenuus, 19 Июля 2012

    Комментарии (17)
  11. Java / Говнокод #8004

    +81

    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
    27. 27
    /*
     * Copyright 2009 Sun Microsystems, Inc.
     * All rights reserved.  You may not modify, use,
     * reproduce, or distribute this software except in
     * compliance with  the terms of the License at:
     * http://developer.sun.com/berkeley_license.html
     */
    
    
    package cart.util;
    
    public class IdVerifier {
        public IdVerifier() {
        }
    
        public boolean validate(String id) {
            boolean result = true;
    
            for (int i = 0; i < id.length(); i++) {
                if (Character.isDigit(id.charAt(i)) == false) {
                    result = false;
                }
            }
    
            return result;
        }
    }

    Java EE tutorial

    ingenuus, 27 Сентября 2011

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