Skip to content

Commit

Permalink
Fix for A5-1-3 false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
rak3-sh committed Aug 23, 2023
1 parent c5bf50b commit 802e6cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions change_notes/2023-07-11-lambda-expr-without-param-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Only consider lambdas that have zero arguments, since any lambda with non-zero arguments will have an explicit argument list.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ where
not isExcluded(lambda, LambdasPackage::lambdaExpressionWithoutParameterListQuery()) and
lambdaFunction = lambda.getLambdaFunction() and
not lambdaFunction.isAffectedByMacro() and
// If it has a parameter, then it will have an
// explicit parameter list. Therefore, proceed to check only if the lambda
// does not have any parameters.
not exists (lambdaFunction.getAParameter()) and
// The extractor doesn't store the syntactic information whether the parameter list
// is enclosed in parenthesis. Therefore we cannot determine if the parameter list is
// explicitly specified when the parameter list is empty.
Expand Down

0 comments on commit 802e6cd

Please sign in to comment.