Skip to content

VBC-077: deceptive-function-name

error

Category: clean-code
Analysis: AST
Tags: clean-code semantic

What it reports

Lying function name detected: '{name}' implies a non-mutating action but contains side-effect keywords (set, delete, update). This is major vibecoding.

Flagged

ts
function getUser(id) {
  this.cache.set(id, 1);
  return id;
}
ts
class E {
  getLevel() {
    if (!this.buf) { this.hits = this.hits + 1; }
    return this.buf;
  }
}

Not flagged

ts
function getUser(id) {
  return this.users[id];
}
ts
function getOffset(node) {
  return node.dataset.offset;
}
ts
class E {
  getMasterLevel() {
    if (!this.buf || this.buf.length !== this.analyser.fftSize) {
      this.buf = new Float32Array(this.analyser.fftSize);
    }
    return rms(this.buf);
  }
}
ts
class R {
  async fetchFromRemote(url) {
    this.fetched = true;
    return fetch(url);
  }
}
ts
function getAll() {
  const out = [];
  for (const x of this.buffer) out.push(x);
  return out;
}

AST check

  • Type: lying-function-names

Released under the MIT License.