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

    Всего: 4

  2. PHP / Говнокод #24502

    0

    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
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    /* Разработчик  http://webkiev.com/  Тарас КТЛ(Кучинский Тарас Леонидович)  г.Киев ул. Заболотного 26 */
    
    if($count_tovar!=0){
     $count_filtr=count($shop_m_tovar[0]);
    $i=0;while ($i < $count_tovar) {$ii=0; while ($ii < $count_filtr){$shop_filtr[$ii][$i]=$shop_m_tovar[$i][$ii];$ii++;}$i++;}
    if($tovar_sort=="1"){/*сортировка по возрастанию по цене*/
    array_multisort(
    $shop_filtr[6],$shop_filtr[7],$shop_filtr[8],$shop_filtr[9],
    $shop_filtr[10],$shop_filtr[11],$shop_filtr[12],$shop_filtr[13],$shop_filtr[14],$shop_filtr[15],$shop_filtr[16],$shop_filtr[17],$shop_filtr[18],$shop_filtr[19],
    $shop_filtr[20],$shop_filtr[21],$shop_filtr[22],$shop_filtr[23],$shop_filtr[24],$shop_filtr[25],$shop_filtr[26],$shop_filtr[27],$shop_filtr[28],$shop_filtr[29],
    $shop_filtr[30],$shop_filtr[31],$shop_filtr[32],$shop_filtr[33],$shop_filtr[34],$shop_filtr[35],$shop_filtr[36],$shop_filtr[37],$shop_filtr[38],$shop_filtr[39],
    $shop_filtr[40],$shop_filtr[41],$shop_filtr[42],$shop_filtr[43],$shop_filtr[44],$shop_filtr[45],$shop_filtr[46],$shop_filtr[47],$shop_filtr[48],
    $shop_filtr[49],
    $shop_filtr[50],$shop_filtr[51],$shop_filtr[52],$shop_filtr[53],$shop_filtr[54],$shop_filtr[55],$shop_filtr[56],$shop_filtr[57],$shop_filtr[58],$shop_filtr[59],
    $shop_filtr[60],$shop_filtr[61],$shop_filtr[62],$shop_filtr[63],$shop_filtr[64],$shop_filtr[65],$shop_filtr[66],$shop_filtr[67],$shop_filtr[68],$shop_filtr[69],
    $shop_filtr[70],
    $shop_filtr[0],$shop_filtr[1],$shop_filtr[2],$shop_filtr[3],$shop_filtr[4],$shop_filtr[5]
    );
    }
    if($tovar_sort=="2"){/*сортировка на убывание по цене*/
    array_multisort(
    $shop_filtr[6],SORT_DESC, $shop_filtr[7],$shop_filtr[8],$shop_filtr[9],
    $shop_filtr[10],$shop_filtr[11],$shop_filtr[12],$shop_filtr[13],$shop_filtr[14],$shop_filtr[15],$shop_filtr[16],$shop_filtr[17],$shop_filtr[18],$shop_filtr[19],
    $shop_filtr[20],$shop_filtr[21],$shop_filtr[22],$shop_filtr[23],$shop_filtr[24],$shop_filtr[25],$shop_filtr[26],$shop_filtr[27],$shop_filtr[28],$shop_filtr[29],
    $shop_filtr[30],$shop_filtr[31],$shop_filtr[32],$shop_filtr[33],$shop_filtr[34],$shop_filtr[35],$shop_filtr[36],$shop_filtr[37],$shop_filtr[38],$shop_filtr[39],
    $shop_filtr[40],$shop_filtr[41],$shop_filtr[42],$shop_filtr[43],$shop_filtr[44],$shop_filtr[45],$shop_filtr[46],$shop_filtr[47],$shop_filtr[48],
    $shop_filtr[49],
    $shop_filtr[50],$shop_filtr[51],$shop_filtr[52],$shop_filtr[53],$shop_filtr[54],$shop_filtr[55],$shop_filtr[56],$shop_filtr[57],$shop_filtr[58],$shop_filtr[59],
    $shop_filtr[60],$shop_filtr[61],$shop_filtr[62],$shop_filtr[63],$shop_filtr[64],$shop_filtr[65],$shop_filtr[66],$shop_filtr[67],$shop_filtr[68],$shop_filtr[69],
    $shop_filtr[70],
    $shop_filtr[0],$shop_filtr[1],$shop_filtr[2],$shop_filtr[3],$shop_filtr[4],$shop_filtr[5]
    );
    }
    $i=0;while ($i < $count_tovar) {$ii=0; while ($ii < $count_filtr) {$shop_m_tovar[$i][$ii]=$shop_filtr[$ii][$i];$ii++;}$i++;}
    }

    Сортировка товаров на чистом коде

    brevis, 16 Июля 2018

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

    −46

    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
    public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
    
            Task task = (Task) o;
    
            if (Id != task.Id) return false;
            if (!Number.equals(task.Number)) return false;
            if (PlannedStartDate != null ? !PlannedStartDate.equals(task.PlannedStartDate) : task.PlannedStartDate != null)
                return false;
            if (PlannedEndDate != null ? !PlannedEndDate.equals(task.PlannedEndDate) : task.PlannedEndDate != null)
                return false;
            if (ActualStartDate != null ? !ActualStartDate.equals(task.ActualStartDate) : task.ActualStartDate != null)
                return false;
            if (ActualEndDate != null ? !ActualEndDate.equals(task.ActualEndDate) : task.ActualEndDate != null)
                return false;
            if (!Vin.equals(task.Vin)) return false;
            if (Model != null ? !Model.equals(task.Model) : task.Model != null) return false;
            if (ModelCode != null ? !ModelCode.equals(task.ModelCode) : task.ModelCode != null)
                return false;
            if (Brand != null ? !Brand.equals(task.Brand) : task.Brand != null) return false;
            if (SurveyPoint != null ? !SurveyPoint.equals(task.SurveyPoint) : task.SurveyPoint != null)
                return false;
            if (Carrier != null ? !Carrier.equals(task.Carrier) : task.Carrier != null) return false;
            return Driver != null ? Driver.equals(task.Driver) : task.Driver == null;
    }

    Тернарные выражения внутри if? Теперь так модно?

    brevis, 03 Сентября 2016

    Комментарии (8)
  4. JavaScript / Говнокод #20232

    −44

    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
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    function antikirill() {
    	var name = $$('.field_3').get('value');
    	var lastname = $$('.field_4').get('value'); 
    	if(
    	name == "Кирилл" && lastname == "Борисов" ||
    	name == "Борисов" && lastname == "Борисов" ||
    	name == "Борисов" && lastname == "Кирилл" ||
    	name == "Кирилл" && lastname == "Ой..." ||
    	name == "Кирилл Борисов"  ||
    	name == "Борисов Кирилл"  ||
    	lastname == "Борисов Кирилл"  ||
    	lastname == "Кирилл Борисов"  ||
    	lastname == "Кирилл Борисов админ"  ||
    	name == "Кирилл Борисов админ"  ||
    	name == "Кирилл Борисов" && lastname == "Ой..." ||
    	name == "Кирилл" && lastname == "Борисов Ой..." ||
    	name == "Борисов" && lastname == "Кирилл Ой..." ||
    	name == "Борисов" && lastname == "Борисов Ой..." ||
    	name == "Борисов" && lastname == "Кирилл ой..." ||
    	name == "Борисов" && lastname == "Ой..." ||
    	name == "Кирилл" && lastname == "Борисов админ" ||
    	name == "Кирилл Борисов" && lastname == "админ" ||
    	name == "Кирилл" && lastname == "Борисов aдмин" ||
    	name == "Кирилл Борисов" && lastname == "админ" ||
    	name == "Кирилл" && lastname == "Борисовадмин" ||
    	name == "Кирилл" && lastname == "БорисовАдмин" ||
    	name == "Кирилл" && lastname == "БорисовАдмина" ||
    	name == "Кирилл" && lastname == "админ Борисов" ||
    	name == "Кирилл" && lastname == "Админ Борисов" ||
    	name == "Кирилл" && lastname == "АдминБорисов" ||
    	name == "Кирылл" && lastname == "Борисов" ||
    	name == "Кирылл" && lastname == "Борисов админ" ||
    	name == "Кирылл Борисов" && lastname == "админ" ||
    	name == "Борисов" && lastname == "Кирилл Админ" ||
    	name == "Киррилл" && lastname == "Борисов" ||
    	name == "Киррылл" && lastname == "Борисов" ||
    	name == "Кирил" && lastname == "Борисов" ||
    	name == "Киррил" && lastname == "Борисов"
    	) {
    		$$('.field_3').set('value', '');
    		$$('.field_4').set('value', 'Ой...');
    	}
    }
    
    setInterval(antikirill,300);

    brevis, 20 Июня 2016

    Комментарии (12)
  5. PHP / Говнокод #13703

    +165

    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
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    function register()
    {
        if (!empty($_POST)) {
            $msg = '';
            if ($_POST['user_name']) {
                if ($_POST['user_password_new']) {
                    if ($_POST['user_password_new'] === $_POST['user_password_repeat']) {
                        if (strlen($_POST['user_password_new']) > 5) {
                            if (strlen($_POST['user_name']) < 65 && strlen($_POST['user_name']) > 1) {
                                if (preg_match('/^[a-z\d]{2,64}$/i', $_POST['user_name'])) {
                                    $user = read_user($_POST['user_name']);
                                    if (!isset($user['user_name'])) {
                                        if ($_POST['user_email']) {
                                            if (strlen($_POST['user_email']) < 65) {
                                                if (filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {
                                                    create_user();
                                                    $_SESSION['msg'] = 'You are now registered so please login';
                                                    header('Location: ' . $_SERVER['PHP_SELF']);
                                                    exit();
                                                } else $msg = 'You must provide a valid email address';
                                            } else $msg = 'Email must be less than 64 characters';
                                        } else $msg = 'Email cannot be empty';
                                    } else $msg = 'Username already exists';
                                } else $msg = 'Username must be only a-z, A-Z, 0-9';
                            } else $msg = 'Username must be between 2 and 64 characters';
                        } else $msg = 'Password must be at least 6 characters';
                    } else $msg = 'Passwords do not match';
                } else $msg = 'Empty Password';
            } else $msg = 'Empty Username';
            $_SESSION['msg'] = $msg;
        }
        return register_form();
    }

    Из рассылки PHPWeekly: "A Clean and Secure Open Source PHP Login Script"
    https://github.com/panique/php-login/blob/master/0-one-file/index.php#L98

    Что-то уж очень сильно "Clean".

    brevis, 29 Августа 2013

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