JS: improve alert location of js/angular/repeated-dependency-injection

This commit is contained in:
Esben Sparre Andreasen
2018-12-11 14:09:12 +01:00
parent 5acd1ca26d
commit b5bbf990b0
3 changed files with 9 additions and 1 deletions

View File

@@ -10,8 +10,9 @@
*/
import javascript
import semmle.javascript.RestrictedLocations
from AngularJS::InjectableFunction f, ASTNode explicitInjection
where count(f.getAnExplicitDependencyInjection()) > 1 and
explicitInjection = f.getAnExplicitDependencyInjection()
select f.asFunction(), "This function has $@ defined in multiple places.", explicitInjection, "dependency injections"
select (FirstLineOf)f.asFunction(), "This function has $@ defined in multiple places.", explicitInjection, "dependency injections"