Security & Compliance
Significant FLS and CRUD gaps require immediate attention
Production Instance
After comprehensive analysis of 847 components across your Salesforce production instance, we've identified a platform that functions adequately but carries significant technical risk. The overall health score of 6.2 reflects an org that has grown organically over several years without consistent architectural governance.
The most pressing concern is security posture, scoring 5.4. We identified 12 Apex classes that bypass field-level security checks, creating potential data exposure risks. Additionally, the automation landscape shows signs of conflict, with multiple competing triggers and flows on key objects like Account and Opportunity.
The positive news: your core code quality is reasonable at 7.1, and there's evidence of good patterns in newer development. With focused remediation over 2-3 sprints, the critical issues can be addressed while establishing guardrails to prevent regression.
Significant FLS and CRUD gaps require immediate attention
Solid foundation with opportunities for consistency
Competing automations creating execution conflicts
Partial adoption of patterns, inconsistent implementation
Accumulated debt in legacy components needs remediation
The following findings represent the highest-priority issues identified during our assessment. They are ordered by severity and business impact, with recommended remediation for each.
12 Apex classes perform SOQL queries and DML operations without enforcing field-level security, potentially exposing sensitive data.
Users may access or modify fields they shouldn't have permission to see or edit, creating compliance and data security risks.
AccountService ·ContactHelper ·LeadProcessor +9 more
Implement Security.stripInaccessible() or WITH SECURITY_ENFORCED clause on all SOQL queries. Consider creating a centralized security utility class.
PaymentGatewayService.cls contains a hardcoded API key on line 47.
Credential exposure in version control, inability to rotate keys without deployment, security audit failures.
PaymentGatewayService
Move credentials to Named Credentials or Custom Metadata. Rotate the exposed key immediately.
Account has 7 competing automations (2 triggers, 3 flows, 1 process builder, 1 workflow) with no clear execution governance.
Unpredictable behavior, potential infinite loops, difficult debugging, governor limit risks during bulk operations.
AccountTrigger ·AccountAfterTrigger ·Account_Assignment_Flow +4 more
Consolidate into single trigger framework entry point plus record-triggered flows. Migrate legacy process builder and workflow.
Account revenue classification logic duplicated across 3 classes with slight variations.
Maintenance burden, risk of inconsistent behavior, bugs when updating one location but not others.
AccountService.classifyByRevenue() ·AccountTriggerHandler.setAccountTier() ·AccountBatchProcessor.determineSegment()
Extract to single AccountClassificationService with standardized tiers. Update all callers.
34 triggers using 4 different patterns: direct logic (12), handler classes (15), framework dispatch (5), mixed (2).
Difficult onboarding, inconsistent error handling, no centralized bypass mechanism, testing complexity.
All triggers
Standardize on single trigger framework (recommend adopting the TriggerDispatcher pattern already present in 5 triggers). Migrate others incrementally.
Security posture requires immediate attention. Multiple classes bypass field-level security, and we identified credential exposure in one integration class.
| Component | Severity | Lines |
|---|---|---|
AccountService | Critical | 23, 45, 67 |
ContactHelper | Critical | 12, 89 |
LeadProcessor | Critical | 34, 56, 78, +1 more |
OpportunityManager | High | 112 |
CaseHandler | High | 45, 67 |
QuoteBuilder | High | 23, 89, 134 |
Create centralized security utility using Security.stripInaccessible() for all DML operations.
Add WITH SECURITY_ENFORCED to all SOQL queries, or implement query wrapper.
Remove hardcoded credentials and implement Named Credentials for all integrations.
Code quality is reasonable with room for improvement in consistency and test coverage. Newer code shows better patterns.
| Class | LOC | Complexity | Recommendation |
|---|---|---|---|
AccountMegaHelper | 1247 | 34 | Split into domain-specific services |
LegacyIntegrationManager | 892 | 28 | Refactor to modern callout patterns |
OrderProcessingEngine | 756 | 22 | Extract order validation and fulfillment |
ReportingUtils | 689 | 19 | Separate report types into individual classes |
AccountService.classifyByRevenue() ↔ AccountTriggerHandler.setAccountTier()ContactHelper.formatAddress() ↔ LeadProcessor.buildAddress()| Rule | Count | Severity |
|---|---|---|
ApexCRUDViolation | 12 | Critical |
CyclomaticComplexity | 8 | High |
AvoidDeeplyNestedIfStmts | 23 | Medium |
ApexSOQLInjection | 2 | Critical |
FieldDeclarationsShouldBeFirst | 45 | Low |
Break down 8 classes exceeding 500 LOC into focused, single-responsibility services.
Extract duplicated code into shared utilities, starting with the 4 exact duplicates.
Increase coverage from 78% to 85%+, focusing on bulk and negative test scenarios.
Automation landscape shows significant complexity with multiple competing mechanisms. Legacy automation needs migration.
The following objects have multiple competing automations that may cause conflicts or unpredictable behavior.
AccountTrigger,AccountAfterTriggerAccount_Assignment_Flow,Account_Enrichment_Flow,Account_Scoring_FlowAccount_Update_ProcessAccount_Status_WorkflowOpportunityTriggerOpp_Stage_Flow,Opp_Notification_FlowOpp_Team_AssignmentOpp_Close_Date_AlertCaseTriggerCase_Escalation_Flow,Case_Assignment_FlowCase_SLA_AlertSalesforce is deprecating Process Builders and Workflow Rules. The following need to be migrated to Flows.
Reduce 7 automations to 1 trigger (with framework) + 2 record-triggered flows. Estimated 40 hours.
Convert 23 Process Builders to Flows before Salesforce deprecation deadline.
Convert 45 Workflow Rules to Flows, starting with high-priority objects.
Partial adoption of architectural patterns with inconsistent implementation. Some excellent newer code alongside legacy approaches.
Type: TriggerDispatcher (partial)
Usage: 15% of triggers
Consistency: poor
Classes: 23
Coverage: 12%
Consistency: moderate
Classes: 8
Coverage: 4%
Consistency: poor
No domain layer pattern detected. Consider implementing for complex business logic.
These classes have grown too large and handle too many responsibilities. They should be refactored into smaller, focused classes.
AccountMegaHelper 1247 LOCResponsibilities: CRUD, validation, enrichment, scoring, notifications
Utilities 678 LOCResponsibilities: Mixed concerns across all domains
Adopt TriggerDispatcher pattern org-wide. Migrate existing triggers incrementally.
Define and document naming standards. Refactor over time during normal maintenance.
Split AccountMegaHelper into AccountService, AccountValidator, AccountEnrichmentService.
Accumulated technical debt across the org, with concentration in older components. Estimated 12-15 sprints for full remediation.
Low-effort improvements that can be addressed immediately for quick impact.
We recommend a phased approach over 4 quarters, prioritizing security and stability before architectural improvements.
Address critical security vulnerabilities and establish security patterns.
Reduce automation complexity and eliminate conflicts.
Improve maintainability and eliminate technical debt.
Establish sustainable patterns and documentation.
This assessment was conducted using Polaris, Northform Systems' proprietary Salesforce analysis platform.