1. Лучший говнокод

    В номинации:
    За время:
  2. PHP / Говнокод #20435

    +1

    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
    static function saveoprosform_ajax()
    {
        global $DB, $USER;
        $task_id = $_REQUEST["task_id"];
        $qlist = $_REQUEST["qlist"];
    
        $sql = "DELETE FROM `tickets_qc_results` WHERE `task_id`=" . $DB->F($task_id) . ";";
        $DB->query($sql);
        $DB->free();
    
        if ($task_id && $qlist) {
            // другой говнокод
            $sql = "INSERT INTO `tickets_qc_results`...';
            $DB->query($sql);
        } else {
            $ret["error"] = "Недостаточно данных для выполнения операции!";
        }
        echo json_encode($ret);
        return false;
    }

    Сначала удаляем, потом проверяем by ©senior shaurma developer

    pahhan, 27 Июля 2016

    Комментарии (12)
  3. C# / Говнокод #20261

    +2

    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
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    using System;
    using System.Collections.Generic;
    using System.Net;
    using System.Web.Script.Serialization;
    
    namespace Govnokod
    {
    	public class Program
    	{
    		private static string input;
    		private static string[] inputargs;
    		private static int inputargsh = 0;
    
    		private static int eax;
    		private static string hax,hbx;
    
    		public static void CommandActions()
    		{
    			if (inputargs[0] == "download")
    			{
    				if (inputargsh > 1)
    				{
    					hax = inputargs[1];
    					hbx = (inputargsh > 2) ? inputargs[2]:null;
    					if (String.IsNullOrEmpty(hbx))
    						hbx = Environment.CurrentDirectory+"\\"+hax;
    					Console.WriteLine("Downloading...");
    				}
    				else Console.WriteLine("invalid argument: 1\n");
    			}
    			else if (inputargs[0] == "apkinfo")
    			{
    				if (inputargsh > 1)
    				{
    					Console.WriteLine("Apkinfo...");
    				}
    				else Console.WriteLine("invalid argument: 1\n");
    			}
    			else if (input != "")
    				Console.WriteLine("invalid command: "+input+"\n");
    			CommandStart();
    		}
    
    		public static void CommandStart()
    		{
    			if (inputargsh != 0)
    			{
    				Array.Clear(inputargs,0,inputargsh);
    				inputargsh = 0;
    			}
    			input = Console.ReadLine();
    			input = input.Trim();
    			hax = input.ToLower();
    			while (true)
    			{
    				eax = hax.IndexOf(' ');
    				Array.Resize(ref inputargs,inputargsh+1);
    				if (eax != -1)
    				{
    					inputargs[inputargsh] = hax.Substring(0,eax);
    					hax = hax.Substring(eax);
    					hax = hax.TrimStart();
    					inputargsh++;
    				}
    				else
    				{
    					inputargs[inputargsh] = hax;
    					inputargsh++;
    					hax = null;
    					break;
    				}
    			}
    			if (inputargs[0] == "quit")
    			{
    				Console.Clear();
    				Console.Write("Press any key to quit...");
    				Console.ReadKey();
    			}
    			else CommandActions();
    		}
    
    		public static void Main(string[] args)
    		{
    			Console.WriteLine("; Commands:");
    			Console.WriteLine(";\tdownload <apk> <path>");
    			Console.WriteLine(";\tapkinfo <apk> or <index>");
    			Console.WriteLine(";\tquit <>\n");
    			CommandStart();
    		}
    	}
    }

    "Распознователь Команд 6120"

    ReckitRockefeller, 23 Июня 2016

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

    +6

    1. 1
    2. 2
    3. 3
    # https://github.com/mpak2/mpak.su/blob/607ee884dddc1df541aefc4f3b06ea5c2bfa4470/modules/users/pass.php
    
    if($_POST['new'] && $_POST['new'] == $_POST['ret']){

    Сравнение пароля на ==

    Для тех кто не знает, http://ideone.com/yPjk4K

    3_dar, 15 Июня 2016

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

    +5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    public void TrimExcess()
    {
    	int num;
    	num = (int) (((double) ((int) this._items.Length)) * 0.9);
    	if (this._size >= num)
    	{
    		goto Label_002A;
    	}
    	this.Capacity = this._size;
    Label_002A:
    	return;
    }

    Хуброхапр

    dm_fomenok, 01 Июня 2016

    Комментарии (12)
  6. C# / Говнокод #20034

    +2

    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
    private long m_IsExecuting;
    
    // ...
    
    public virtual void Execute(object parameter)
    {
    	try
    	{
    		if (Interlocked.Read(ref m_IsExecuting) != 0)
    			return;
    		Interlocked.Increment(ref m_IsExecuting);
    		m_Execute(parameter);
    	}
    	finally
    	{
    		Interlocked.Decrement(ref m_IsExecuting);
    	}
    }

    А за то, что ты меня не пустил, я пущу следующего.

    yamamoto, 18 Мая 2016

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

    +5

    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
    #include <iostream>
    
    namespace __hidden__ {
      struct print {
        bool space;
        print() : space(false) {}
        ~print() { std::cout << std::endl; }
    
        template <typename T>
        print &operator , (const T &t) {
          if (space) std::cout << ' ';
          else space = true;
          std::cout << t;
          return *this;
        }
      };
    }
    
    #define print __hidden__::print(),
    
    int main() {
      int a = 1, b = 2;
      print "this is a test";
      print "the sum of", a, "and", b, "is", a + b;
      return 0;
    }

    Отсюда: [color=violet]http://madebyevan.com/obscure-cpp-features/[/color]

    myaut, 13 Мая 2016

    Комментарии (12)
  8. C++ / Говнокод #19962

    −1

    1. 1
    2. 2
    3. 3
    ID_tables_vec[arg1.get_extra_value()]
         [ID_tables_vec[arg1.get_extra_value()][arg1.get_value()].get_value()]
         .set_name(tmp_str);

    Это один оператор. Из кода интерпретатора модельного языка (задание в универе). Периодически в коде начали возникать подобные вещи, связанные с особенностями таблиц имен. Буду рад, если кто-то предложит эквивалентные, но более читаемые конструкции.

    DrCodeMonkey, 07 Мая 2016

    Комментарии (12)
  9. Assembler / Говнокод #19719

    +81

    1. 1
    mov podi,vilov

    d_fomenok, 29 Марта 2016

    Комментарии (12)
  10. Куча / Говнокод #19505

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    <span style="font-size: 16px; line-height: 12px;">
      <b style="color: rgb(255, 102, 102);background-color:rgb(255, 204, 204);">
        <span <a href="news/"><b style="color:rgb(153, 102, 0);">Новости</b></span>
    ________________________________________________________</b></span>

    html код на одном сайте

    t3dev, 21 Февраля 2016

    Комментарии (12)
  11. C++ / Говнокод #19382

    −1

    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
    #include <iostream>
    using namespace std;
    
    auto print(auto arg)
    {
    	return (cout<<arg);
    	//return cout;
    }
    auto print(auto arg, auto... args)
    {
    	return (print(args...)<<arg);
    	//return cout;
    }
    
    int main() {
    	print(1,"ko")<<"ok";
    	return 0;
    }

    https://ideone.com/YvoHi3
    ГЦЦ так и не научился в возвращаемые значения с авто

    laMer007, 02 Февраля 2016

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