-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add static code rules to the MySQL module #1330
base: master
Are you sure you want to change the base?
Conversation
.../test/java/io/ballerina/stdlib/mysql/compiler/staticcodeanalyzer/StaticCodeAnalyzerTest.java
Show resolved
Hide resolved
import io.ballerina.scan.Rule; | ||
import io.ballerina.scan.RuleKind; | ||
|
||
public class RuleImpl implements Rule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a doc comment for the class. Check for other similar cases
ExpressionNode expression = namedArgument.expression(); | ||
if (expression instanceof BasicLiteralNode basicLiteralNode) { | ||
String passwordValue = basicLiteralNode.literalToken().text(); | ||
passwordValue = passwordValue.substring(1, passwordValue.length() - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just trying to understand; why are we taking a substring here?
hasSecurePassword = true; | ||
} | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this else block require an issue to be reported? Shall we add a small comment similar to what you have done in https://github.com/ballerina-platform/module-ballerinax-mysql/pull/1330/files#diff-6fae5cf6aa18601e6116b6f471bbadf8b93196443c0df31db5a6137060cd735eR65:~:text=//%20Check%20if-,the,-expression%20is%20a explaining the reason?
Codecov ReportAttention: Patch coverage is
❌ Your project check has failed because the head coverage (72.80%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #1330 +/- ##
============================================
- Coverage 80.85% 72.80% -8.06%
+ Complexity 126 125 -1
============================================
Files 20 25 +5
Lines 564 625 +61
Branches 110 119 +9
============================================
- Hits 456 455 -1
- Misses 61 121 +60
- Partials 47 49 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Purpose
Related issues: #7511 #7283
Examples
Checklist