-
Notifications
You must be signed in to change notification settings - Fork 3
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
Testfrules2 #393
base: master
Are you sure you want to change the base?
Testfrules2 #393
Conversation
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.
Code review not passed
This is the summary of issues introduced by this change:
Policy name | Issues |
---|---|
Compliant | 0 |
Intentional | 33 |
Engaging | 5 |
Documentation | 0 |
Resilient | 13 |
Secure | 0 |
Composable | 0 |
Automated | 0 |
Reliable | 0 |
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.
Code review not passed
This is the summary of issues introduced by this change:
Policy name | Issues |
---|---|
Intentional | 33 |
Resilient | 13 |
Automated | 0 |
Engaging | 5 |
Compliant | 0 |
Reliable | 0 |
Documentation | 0 |
Composable | 0 |
Secure | 0 |
new TestDML2().insert1(name); | ||
} | ||
|
||
public void insert2_other(String name, ITestDML other) { |
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.
Intentional: Breach of naming conventions
Severity
Warning
Finding
Method insert2_other
does not match naming conventions. Consider renaming (hint: myMethod
).
Why is this a problem?
Naming conventions help drive consistency across the application, which makes source code easier to read and understand.
Help and documentation
} | ||
} | ||
|
||
public static void insertsInWhileLoops() { |
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.
Intentional: Undocumented Apex method
Severity
Warning
Finding
This method doesn’t include any documentation or explanatory comments.
Why is this a problem?
Documenting code through comments can quickly help others understand the functionality of different classes and methods.
Help and documentation
new TestDML2().insert1(name); | ||
} | ||
|
||
public void insert2_other(String name, ITestDML other) { |
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.
Resilient: Untested method
Severity
Error
Finding
Method insert2_other
is not tested. Please consider adding a test method to ensure it works as expected.
Why is this a problem?
Unit tests ensure that all code meets quality standards before it's deployed. Testing all your code is essential not only to meet Salesforce test coverage requirements but, more importantly, to make sure your logic keeps working as expected as your application evolves.
Help and documentation
} | ||
} | ||
|
||
private class TestDML2 implements ITestDML { |
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.
Intentional: Breach of naming conventions
Severity
Warning
Finding
Class TestDML2
does not match naming conventions. Consider renaming (hint: MyApexClass
).
Why is this a problem?
Naming conventions help drive consistency across the application, which makes source code easier to read and understand.
Help and documentation
parentInsert1(name); | ||
} | ||
|
||
public void insert2_other(String name) { |
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.
Intentional: Breach of naming conventions
Severity
Warning
Finding
Method insert2_other
does not match naming conventions. Consider renaming (hint: myMethod
).
Why is this a problem?
Naming conventions help drive consistency across the application, which makes source code easier to read and understand.
Help and documentation
insert1(name); | ||
} | ||
|
||
public void insert2_other(String name) { |
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.
Intentional: Undocumented Apex method
Severity
Warning
Finding
This method doesn’t include any documentation or explanatory comments.
Why is this a problem?
Documenting code through comments can quickly help others understand the functionality of different classes and methods.
Help and documentation
} | ||
} | ||
|
||
public static void insertsInDoWhileLoops() { |
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.
Engaging: Excessively complex method
Severity
Warning
Finding
Method insertsInDoWhileLoops
has a cyclomatic complexity of 12
.
Why is this a problem?
Complex methods are hard to test and maintain, as they have numerous paths that need to be covered. Keeping cyclomatic complexity low makes testing substantially easier.
@@ -0,0 +1,324 @@ | |||
public class DMLsInLoops { | |||
public static void insertsInForLoops() { |
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.
Intentional: Undocumented Apex method
Severity
Warning
Finding
This method doesn’t include any documentation or explanatory comments.
Why is this a problem?
Documenting code through comments can quickly help others understand the functionality of different classes and methods.
Help and documentation
} | ||
|
||
private class TestDML implements ITestDML { | ||
public void insert1(String name) { |
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.
Intentional: Breach of naming conventions
Severity
Warning
Finding
Method insert1
does not match naming conventions. Consider renaming (hint: myMethod
).
Why is this a problem?
Naming conventions help drive consistency across the application, which makes source code easier to read and understand.
Help and documentation
parentInsert1(name); | ||
} | ||
|
||
public void insert2_other(String name) { |
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.
Resilient: Untested method
Severity
Error
Finding
Method insert2_other
is not tested. Please consider adding a test method to ensure it works as expected.
Why is this a problem?
Unit tests ensure that all code meets quality standards before it's deployed. Testing all your code is essential not only to meet Salesforce test coverage requirements but, more importantly, to make sure your logic keeps working as expected as your application evolves.
Help and documentation
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.
No description provided.