Handvask / handvask

Found single char variable name JS-C1002
Anti-pattern
Minor
a year agoa year old
 19  function onUpdate(id: number, newName: string, newContents: string) {
 20    setData((v) => {
 21      if (!v) return v;
 22      const x = [...v]; 23      x[v.findIndex((instance) => instance.id == id)].contents = newContents;
 24      x[v.findIndex((instance) => instance.id == id)].friendly_name = newName;
 25
 19  function onUpdate(id: number, newName: string, newContents: string) {
 20    setData((v) => {
 21      if (!v) return v;
 22      const x = [...v]; 23      x[v.findIndex((instance) => instance.id == id)].contents = newContents;
 24      x[v.findIndex((instance) => instance.id == id)].friendly_name = newName;
 25
Variable name is too small.
  1export type SuccessResponse = { success: boolean };
  2
  3export function guuid() {
  4  let d = new Date().getTime(),  5    d2 = (performance && performance.now && performance.now() * 1000) || 0;
  6  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
  7    let r = Math.random() * 16;
Variable name is too small.
  4  let d = new Date().getTime(),
  5    d2 = (performance && performance.now && performance.now() * 1000) || 0;
  6  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
  7    let r = Math.random() * 16;  8    if (d > 0) {
  9      r = (d + r) % 16 | 0;
 10      d = Math.floor(d / 16);
Variable name is too small.
 74  callback?: (x: T, code: number) => void,
 75  headers: Record<string, string> = {}
 76) {
 77  const r = new Request(url, { 78    method: "GET", 79    headers: { 80      "X-Requested-With": "XMLHttpRequest", 81      ...headers, 82    }, 83  }); 84  http<T>(r, callback);
 85}
 86