Skip to content

Commit

Permalink
Replace if-else with direct return
Browse files Browse the repository at this point in the history
  • Loading branch information
SachinAkash01 committed Feb 27, 2025
1 parent 2ec1e36 commit f3f69b0
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,8 @@ private boolean isIndirectFunctionParameterFromBinary(BinaryExpressionNode binar
leftRef.name().text().equals(reqParam.paramName().get().text())) {
return true;

Check warning on line 211 in compiler-plugin/src/main/java/io/ballerina/stdlib/io/compiler/staticcodeanalyzer/IOPathInjectionAnalyzer.java

View check run for this annotation

Codecov / codecov/patch

compiler-plugin/src/main/java/io/ballerina/stdlib/io/compiler/staticcodeanalyzer/IOPathInjectionAnalyzer.java#L211

Added line #L211 was not covered by tests
}
if (binaryExpr.rhsExpr() instanceof SimpleNameReferenceNode rightRef &&
rightRef.name().text().equals(reqParam.paramName().get().text())) {
return true;
}
return false;
return binaryExpr.rhsExpr() instanceof SimpleNameReferenceNode rightRef &&
rightRef.name().text().equals(reqParam.paramName().get().text());
}

public static Document getDocument(SyntaxNodeAnalysisContext context) {
Expand Down

0 comments on commit f3f69b0

Please sign in to comment.