Ruby: Traditional if-else not detected as `StringConstArrayInclusionCallBarrier` compared to conditional assignment.
- Langage dominant
- CodeQL
- Étoiles
- 10.1k
- Forks
- 2.1k
- Merge moyen
- 2 j 15 h
- PR mergées (30 j)
- 141
Description
**Information**
CodeQL Version:
7f5df4fc0e9ec8ffed0e8eefe78fb5544be46dc4
**Description of the issue**
Create a database for this ruby code:
```ruby
aaa = "imagine this is derived from a remote source"
if ["fff", "eee"].include?(aaa) # {1}
# accept aaa as is
else
aaa = "Value"
end
aaa = if ["fff", "eee"].include?(aaa) # {2}
aaa
else
"Value"
end
```
**Expected**
1. {1} and {2} are detected as a `StringConstArrayInclusionCall` (using quick-eval)
2. {1} and {2} are detected as a `StringConstArrayInclusionCallBarrier` (using quick-eval)
**Actual**
1. {1} and {2} are detected as a `StringConstArrayInclusionCall` (using quick-eval)
2. {1} **is not** detected as a `StringConstArrayInclusionCallBarrier` (using quick-eval)
3. {2} **is** detected as a `StringConstArrayInclusionCallBarrier` (using quick-eval)
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.