CA Analytics

Content

Run Code Analytics

Extensions → Kupp Code Analytics → Analytics → Run

Rules Overview

PLA001: Target Update

The recommended way to update the plugin target entity is to modify the attributes in the preoperation or prevalidation stage without an explicit update call because the values will be saved automatically in the main operation.

Message: The target entity should not be updated via the IOrganizationService

Solution: Remove the update statement

EBEA001: Early Bound Entities

A shared domain project which includes all domain classes (strong types for the Dataverse data model) should be referenced by the other projects.

Message: Could not detect classes for early bound entities.

Solution: Enable early bound entities

EBEA002: Early Bound Entities

Using of the entity base class should be avoided due to high risk of misspelled names. Strong types are more robust and easier to use.

Message: Late bound entities should be replaced with early bound entities (generated code)

Solution: Use a strong typed class instead

PA001: ColumnSet Parameter

Retrieving all columns has a bad performance impact.

Message: Specify the required columns instead of retrieving all columns

Solution: Specify the required columns.

PA002: Update Columns

Too many attributes can cause unexpected behavior of custom logic.

Message: Attribute collection should only include the changed attributes. Create a new entity for the update.

Solution: Create a new instance or retrieve only the required attributes.

PCA001: Missing plugin base class

A custom base class should handle the call delegation based on the plugin context information.

Message: The IPlugin interface should not be used directly

Solution: Handle the common logic in a base class 

PCA002: Stateful Plugins

Instances of plugin classes will be recreated based on the platform requirements, there is no guarantee that instances are being reused. Data bounded to an instance is mostly not thread-safe.

Message: Plugins should be stateless. Remove all instance properties and variables

Solution: Remove the instance variable

SVA001: Unknown Entities

Invalid entity names will lead to exceptions. Make sure that the name is correctly spelled.

Message: Entity Logicalname '{0}' doesn't exist

Solution: Use the correct name.

SVA002: Unknown Attributes

Invalid attribute names will lead to exceptions. Make sure that the name is correctly spelled.

Message: Attribute Logicalname '{0}' doesn't exist

Solution: Use IntelliSense to find the right name

SGVA001: Sequential Guids

A predefined can lead to bad performance on the database layer. For business data which must not be aligned between environments (e.g. configs) the ID parameter for create operations should not be set.

Message: Id's should be generated by the platform

Solution: For create operation, do not set the ID 

Need help? Contact support