Get rid of the flag with this pattern:

```js
if(scope.variables.some(function(variable) { return variable.name === identifier; }))
  return true;

if(scope.references.some(function(variable) { return reference.identifier.name === identifier; }))
  return true;

// ...

return false;
```