Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Testfrules2 #393

wants to merge 3 commits into from

Conversation

Gabriele-Clayton
Copy link
Contributor

No description provided.

Copy link

@clayton-staging clayton-staging bot left a 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

See the full report to learn more.

@clayton-staging clayton-staging bot dismissed their stale review May 10, 2024 09:18

This code review is obsolete

Copy link

@clayton-staging clayton-staging bot left a 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

See the full report to learn more.

new TestDML2().insert1(name);
}

public void insert2_other(String name, ITestDML other) {

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() {

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) {

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 {

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) {

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) {

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() {

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() {

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) {

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) {

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

Copy link

@clayton-staging clayton-staging bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code passed with warnings

See the full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant