Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V7035. Suspicious property...
menu mobile close menu
Additional information
toggle menu Contents

V7035. Suspicious property implementation. Another field should probably be returned or assigned instead.

Aug 04 2026

The analyzer has detected a property that references a field different from the one specified in the name.

The example:

class Vector2 {
  constructor() {
    this._x = 0;
    this._y = 0;
  }
  
  get x() { 
    return this._x; 
  }
  
  get y() { 
    return this._x;  // <=
  } 
}

In the example, developers tried to declare the x and y properties to access the _x and _y fields, but the y property returns the wrong field.

The fixed code:

class Vector2 {
  constructor() {
    this._x = 0;
    this._y = 0;
  }
  
  get x() { 
    return this._x; 
  }
  
  get y() { 
    return this._y; // <=
  } 
}

The analyzer also issues a warning when the field and method names do not match:

class Rights {
  constructor() {
    this.read = false;
    this.write = false;
  }

  setRead(value) { 
    this.read = value; 
  }
  
  setWrite(value) { 
    this.read = value;   // <=
  } 
}

What a quick draw in the Wild West of Coding —
you caught the bug in sec!
But we catch them in milliseconds. How about a duel?

Try free