This is my code:
const a = function(obj) {
  for (let key in obj) {
    if (!obj.hasOwnProperty(key)) {
      continue;
    }
    console.info(key.split('_'));
  }
};
a({a_b: 123});
I thought there is no problem at all but SonarQube gives me a critical error:
TypeError can be thrown as "key" might be null or undefined here.
The word key in key.split('_') is highlighted. Indicating variable key can be undefined/null here.
I tried to pass in something like {[undefined]: 123}, and the variable key becomes a string "undefined" instead of real undefined.
Hence. I am wondering will the key be undefined/null in any possible situation? Or is it just a False Positive?
Here is a screenshot:

 
    