(name, node)
| 149 | } |
| 150 | |
| 151 | function isInCryptoKeyBranch(name, node) { |
| 152 | for (let current = node.parent; current; current = current.parent) { |
| 153 | if (current.type !== 'IfStatement') continue; |
| 154 | if (isNodeWithin(node, current.consequent) && |
| 155 | getConsequentCryptoKeys(current.test).has(name)) { |
| 156 | return true; |
| 157 | } |
| 158 | if (current.alternate && |
| 159 | isNodeWithin(node, current.alternate) && |
| 160 | getAlternateCryptoKeys(current.test).has(name)) { |
| 161 | return true; |
| 162 | } |
| 163 | } |
| 164 | return false; |
| 165 | } |
| 166 | |
| 167 | function followsExitingCryptoKeyGuard(name, node) { |
| 168 | const location = findStatementInBlock(node); |
no test coverage detected
searching dependent graphs…