$

paste your code. get roasted.

// drop your code below and we'll rate it — brutally honest or full roast mode

12345678910111213141516
310/2,000
// maximum sarcasm enabled
0 codes roasted·avg score: 0.0/10
//shame_leaderboard

// the worst code on the internet, ranked by shame

$ view_all >>
#1
score:4.0
15 lines
123456789101112131415
<?php
// Nome do arquivo original
$arquivoOriginal = 'foto.jpg';

// Nome do arquivo a ser criado (cópia)
$arquivoCopia = 'copias/foto_backup.jpg';

// A função copy() realiza a cópia
if (copy($arquivoOriginal, $arquivoCopia)) {
    echo "Arquivo copiado com sucesso!";
} else {
    echo "Erro ao copiar o arquivo.";
}
?>
#2
score:4.0
16 lines
12345678910111213141516
function calculateTotal(items) {
  var total = 0;
  for (var i = 0; i < items.length; i++) {
    total = total + items[i].price;
  }

  if (total > 100) {
    console.log("discount applied");
    total = total - 5;
  }

  // TODO: handle tax calculation
  // TODO: handle currency conversion

  return total;
}
#3
score:6.0
21 lines
123456789101112131415161718192021
	const highlight = useCallback(
		(code: string, langKey: LanguageKey | null): string => {
			if (!highlighter) return escapeHtml(code);

			const shikiLang = langKey ? LANGUAGES[langKey]?.shiki : null;
			const lang =
				shikiLang && loadedLangsRef.current.has(shikiLang)
					? shikiLang
					: "plaintext";

			try {
				return highlighter.codeToHtml(code, {
					lang,
					theme: "vesper",
				});
			} catch {
				return escapeHtml(code);
			}
		},
		[highlighter],
	);
showing top 3 codes · view full leaderboard >>