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

Summer24 test 3 #397

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

Summer24 test 3 #397

wants to merge 21 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
Intentional 2
Secure 3
Compliant 0
Composable 0
Resilient 6
Reliable 0
Engaging 0
Automated 0

See the full report to learn more.

@@ -0,0 +1,607 @@
<?xml version="1.0" encoding="UTF-8"?>

Choose a reason for hiding this comment

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

Secure: Flow without access restrictions

Severity

Warning

Finding

This flow doesn't define any access restriction. Permissions to run certain flows should be defined either at the profile or at the permission set level.

Why is this a problem?

As a best practice, flows should be restricted to specific users. Omitting restrictions gives all users the possibility to invoke a flow, which is typically undesirable.

Help and documentation

@@ -0,0 +1,12 @@
public class ApexCdpQueryUsageExample {

public static void positive(List<Line_Item__c> items) {

Choose a reason for hiding this comment

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

Intentional: Unnecessary code

Severity

Warning

Finding

Method positive is not necessary. Consider removing it.

Why is this a problem?

Removing unnecessary code makes your app cleaner, more efficient and easier to understand.

label='Process Account'
description='Process an account record.'
)
public static void processAccount(List inputs) {

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 processAccount 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

@@ -0,0 +1,12 @@
public class ApexCdpQueryUsageExample {

public static void positive(List<Line_Item__c> items) {

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 positive 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

}


public static void negative(List<Line_Item__c> items) {

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 negative 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

}

static testMethod void testGetMethod(){
Account acc = new Account();

Choose a reason for hiding this comment

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

Resilient: Test without data factory or builder

Severity

Error

Finding

The variable Account() is created directly within a test method. Please use a data builder or a data factory to centralise the creation of test data and limit the impact of any changes to validation rules.

Why is this a problem?

Test methods should not create record instances directly as they would break whenever adding validation rules. As a best practice, the creation of test data records should be centralised using test data factories or builders.

Help and documentation

label='Process Account'
description='Process an account record.'
)
public static void processAccount(List inputs) {

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 processAccount 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

}

static testMethod void testDeleteMethod(){
Account acc = new Account();

Choose a reason for hiding this comment

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

Resilient: Test without data factory or builder

Severity

Error

Finding

The variable Account() is created directly within a test method. Please use a data builder or a data factory to centralise the creation of test data and limit the impact of any changes to validation rules.

Why is this a problem?

Test methods should not create record instances directly as they would break whenever adding validation rules. As a best practice, the creation of test data records should be centralised using test data factories or builders.

Help and documentation

}


public static void negative(List<Line_Item__c> items) {

Choose a reason for hiding this comment

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

Intentional: Unnecessary code

Severity

Warning

Finding

Method negative is not necessary. Consider removing it.

Why is this a problem?

Removing unnecessary code makes your app cleaner, more efficient and easier to understand.

@@ -0,0 +1,607 @@
<?xml version="1.0" encoding="UTF-8"?>

Choose a reason for hiding this comment

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

Secure: Flow without access restrictions

Severity

Warning

Finding

This flow doesn't define any access restriction. Permissions to run certain flows should be defined either at the profile or at the permission set level.

Why is this a problem?

As a best practice, flows should be restricted to specific users. Omitting restrictions gives all users the possibility to invoke a flow, which is typically undesirable.

Help and documentation

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.

None yet

2 participants