Found the usage of undeclared variables JS-0125
Bug risk
Critical
9 occurrences in this check
'context' is not defined To fix this, add mocha in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
 94    appleY = Math.floor(Math.random() * tileCount);
 95  }
 96  context.fillStyle = "red";
 97  context.fillRect( 98    appleX * gridSize,
 99    appleY * gridSize,
100    gridSize - 2,
'context' is not defined To fix this, add mocha in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
 93    appleX = Math.floor(Math.random() * tileCount);
 94    appleY = Math.floor(Math.random() * tileCount);
 95  }
 96  context.fillStyle = "red"; 97  context.fillRect(
 98    appleX * gridSize,
 99    appleY * gridSize,
'context' is not defined To fix this, add mocha in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
 73
 74  context.fillStyle = "lime";
 75  for (let i = 0; i < trail.length; i++) {
 76    context.fillRect( 77      trail[i].x * gridSize,
 78      trail[i].y * gridSize,
 79      gridSize - 2,
'context' is not defined To fix this, add mocha in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
 71  context.fillStyle = "black";
 72  context.fillRect(0, 0, canvas.width, canvas.height);
 73
 74  context.fillStyle = "lime"; 75  for (let i = 0; i < trail.length; i++) {
 76    context.fillRect(
 77      trail[i].x * gridSize,
'canvas' is not defined
 69  }
 70
 71  context.fillStyle = "black";
 72  context.fillRect(0, 0, canvas.width, canvas.height); 73
 74  context.fillStyle = "lime";
 75  for (let i = 0; i < trail.length; i++) {
'canvas' is not defined
 69  }
 70
 71  context.fillStyle = "black";
 72  context.fillRect(0, 0, canvas.width, canvas.height); 73
 74  context.fillStyle = "lime";
 75  for (let i = 0; i < trail.length; i++) {
'context' is not defined To fix this, add mocha in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
 69  }
 70
 71  context.fillStyle = "black";
 72  context.fillRect(0, 0, canvas.width, canvas.height); 73
 74  context.fillStyle = "lime";
 75  for (let i = 0; i < trail.length; i++) {
'context' is not defined To fix this, add mocha in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
 68    playerY = tileCount - 1;
 69  }
 70
 71  context.fillStyle = "black"; 72  context.fillRect(0, 0, canvas.width, canvas.height);
 73
 74  context.fillStyle = "lime";
'context' is not defined To fix this, add mocha in environment array of .deepsource.toml. Read more in our documentation https://deepsource.io/docs/analyzer/javascript
  1window.onload = function () {
  2  let canvas = document.getElementById("canvas");
  3  context = canvas.getContext("2d");  4  document.addEventListener("keydown", keyPush);
  5  setInterval(game, 1000 / 15);
  6};