我有以下代码:
return _.map(_.compact([
$scope.status() ? false : "status",
($scope.evidenceLevel || {}).id ? false : "evidence_level",
($scope.association || {}).id ? false : "association",
$scope.predictiveStatement ? false : "predictive_statement",
$scope.evidenceStatement ? false : "evidence_statement",
($scope.hasIncludedReference() || isReferred()) ? false : "reference"
]), myFunction);
Sonarqube 觉得这个方法太复杂了(complexity 为 11,max allowed 为 10),这样的代码有没有标准函数 - ($scope.association || {}).id?