[英]Fortify doesn't recognize lambda
Dead Code: Unused Method
无效代码:未使用的方法
Fortify is detecting lambda methods as unused. Fortify正在检测lambda方法是否未使用。 For instance: I have the below method:
getCountryCode
, even though its used in many places, fortify is reporting it as an unused method. 例如:我有以下方法:
getCountryCode
,即使它在很多地方都使用过,fortify也将其报告为未使用的方法。
private List<String> getCountryCodeAsList(Map<Long, String> countryData, List<String> nationalityRestriction) {
return nationalityRestriction.parallelStream().filter(r -> !org.apache.commons.lang3.StringUtils.isBlank(r))
.map(r -> getCountryCode(countryData, r)).collect(Collectors.toList());
}
private String getCountryCode(Map<Long, String> countryData, String r) {
return !org.apache.commons.lang3.StringUtils.isBlank(r) ? countryData.get(Long.parseLong(r)): null;
}
How to fix this issue? 如何解决这个问题? Any pointers?
有指针吗?
Currently Fortify SCA only supports lambdas in a subset of the languages it can scan that use lambda expressions. 当前,Fortify SCA仅支持可以使用lambda表达式扫描的部分语言的lambda。 Fortify SCA implemented a new built-in analyzer that they call the Higher Order analyzer to accomplish this, but it will only work with the following languages: JavaScript, Python, Ruby, and Swift.
Fortify SCA实现了一个新的内置分析器,他们将其称为高阶分析器来完成此操作,但它仅适用于以下语言:JavaScript,Python,Ruby和Swift。
So the short answer to your question is that you can't really do anything until Fortify implements support for Java lambda expressions in their Higher Order analyzer. 因此,对您问题的简短回答是,直到Fortify在其高阶分析器中实现对Java lambda表达式的支持之前,您实际上无法做任何事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.