Skip to content

Fix for A5-1-3 false positives #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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