You need to sign in to do that
Don't have an account?
Kelsey Shannon
Code clean up advice needed
Can anyone recommend videos/articles/best practices for cleaning up old code in an org?
I inherited a messy org - 10 yrs old, 20+ triggers per object, hundreds of workflows/declarative items, and we are constantly hitting governor limits. Our code coverage is also below 75% now preventing us from deploying anything new...
My management team has granted us a 4 month new code/new project freeze to get this fixed and I don't want to waste it.
I inherited a messy org - 10 yrs old, 20+ triggers per object, hundreds of workflows/declarative items, and we are constantly hitting governor limits. Our code coverage is also below 75% now preventing us from deploying anything new...
My management team has granted us a 4 month new code/new project freeze to get this fixed and I don't want to waste it.
1) The default reports of Salesforce at first (often the most accurate)
Setup > Quick find = Optimizer, Lightning Experience > Check Readiness, Optimize with Features
Simple and costs nothing (very briefly): https://orgdoctor.herokuapp.com/
It is a New-Zealand tool from: https://cloudtoolkit.co/
2) Code Robot (Free): a generator of Apex unit tests : https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000ErI5CUAV
3) PMD (Free): An extensible cross-language static code analyzer.
Performance (apex) : governor limits.
https://pmd.github.io/pmd-5.5.7/pmd-apex/rules/index.html
- Avoid Soql In Loops: New objects created within loops should be checked to see if they can created outside them and reused.
- Avoid Dml Statements In Loops: Avoid DML statements inside loops to avoid hitting the DML governor limit. Instead, try to batch up the data into a list and invoke your DML once on that list of data outside the loop.
It is a Robert Sösemann's tool: https://github.com/rsoesemann?tab=repositoriesPlantUML (Free) diagram generator for Salesforce orgs: https://github.com/rsoesemann/SalesforcePlantUML
4) Config Workbook (Free): reports of the metadata
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000000q4evEAA
All Answers
1) The default reports of Salesforce at first (often the most accurate)
Setup > Quick find = Optimizer, Lightning Experience > Check Readiness, Optimize with Features
Simple and costs nothing (very briefly): https://orgdoctor.herokuapp.com/
It is a New-Zealand tool from: https://cloudtoolkit.co/
2) Code Robot (Free): a generator of Apex unit tests : https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000ErI5CUAV
3) PMD (Free): An extensible cross-language static code analyzer.
Performance (apex) : governor limits.
https://pmd.github.io/pmd-5.5.7/pmd-apex/rules/index.html
- Avoid Soql In Loops: New objects created within loops should be checked to see if they can created outside them and reused.
- Avoid Dml Statements In Loops: Avoid DML statements inside loops to avoid hitting the DML governor limit. Instead, try to batch up the data into a list and invoke your DML once on that list of data outside the loop.
It is a Robert Sösemann's tool: https://github.com/rsoesemann?tab=repositoriesPlantUML (Free) diagram generator for Salesforce orgs: https://github.com/rsoesemann/SalesforcePlantUML
4) Config Workbook (Free): reports of the metadata
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000000q4evEAA
Test Class Generator for Salesforce: not Free.
Following are the limitation,
1. Free version supports upto 400 lines of class. Contact support@tgenbooster.com for advanced features.
2. Free version can create data upto 2 objects only. Please contact at support@tgenbosster.com for advanced features.
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000EFozgUAD