generated from Szandor72/devops-center-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
744 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
force-app/main/default/classes/AccountService.cls | ||
force-app/main/default/classes/AccountService.cls-meta.xml | ||
# Add all files that should be treated as legacy files here, e.g.: | ||
# force-app/main/default/classes/ContentDocumentTriggerHandler.cls | ||
force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml | ||
force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml | ||
force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml | ||
force-app/main/default/classes/AccountService.cls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
name: Code Scans with SFDX Scanner | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- integration | ||
paths: | ||
- 'force-app/**' | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- integration | ||
paths: | ||
- "force-app/**" | ||
|
||
jobs: | ||
sfdx-scanner: | ||
name: 'Validate Code' | ||
uses: 'Szandor72/devops-center-actions/.github/workflows/validate-code.yml@main' | ||
secrets: inherit | ||
sfdx-scanner: | ||
name: "Validate Code" | ||
uses: "Szandor72/devops-center-actions/.github/workflows/validate-code.yml@main" | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
name: Validate Deployment | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- integration | ||
paths: | ||
- 'force-app/**' | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- integration | ||
paths: | ||
- "force-app/**" | ||
|
||
jobs: | ||
validate-deployment: | ||
name: 'SFDX Scanner' | ||
uses: 'Szandor72/devops-center-actions/.github/workflows/validate-deployment.yml@main' | ||
secrets: inherit | ||
validate-deployment: | ||
name: "SFDX Scanner" | ||
uses: "Szandor72/devops-center-actions/.github/workflows/validate-deployment.yml@main" | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
name: Custom Metadata Checks | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- integration | ||
paths: | ||
- 'force-app/**' | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- integration | ||
paths: | ||
- "force-app/**" | ||
|
||
jobs: | ||
validate-metadata: | ||
name: 'Validate Metadata' | ||
uses: 'Szandor72/devops-center-actions/.github/workflows/validate-metadata.yml@main' | ||
validate-metadata: | ||
name: "Validate Metadata" | ||
uses: "Szandor72/devops-center-actions/.github/workflows/validate-metadata.yml@main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ | ||
"orgName": "Demo company", | ||
"edition": "Developer", | ||
"features": ["EnableSetPasswordInApi"], | ||
"settings": { | ||
"lightningExperienceSettings": { | ||
"enableS1DesktopEnabled": true | ||
}, | ||
"mobileSettings": { | ||
"enableS1EncryptedStoragePref2": false | ||
} | ||
"orgName": "Demo company", | ||
"edition": "Developer", | ||
"features": ["EnableSetPasswordInApi"], | ||
"settings": { | ||
"lightningExperienceSettings": { | ||
"enableS1DesktopEnabled": true | ||
}, | ||
"mobileSettings": { | ||
"enableS1EncryptedStoragePref2": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/** | ||
* AccountService Class | ||
* Provides various services related to Account object | ||
*/ | ||
public class AccountService { | ||
/** | ||
* Fetches details for a given account | ||
* @param accountId The ID of the account | ||
* @return Account The details of the account | ||
*/ | ||
public Account getAccDetails(Id accountId) { | ||
// SOQL query inside a loop - bad practice | ||
for (Id accId : new List<Id>{ accountId }) { | ||
Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; | ||
return acc; | ||
} | ||
return null; | ||
} | ||
|
||
public Account getAccDetails2(Id accountId) { | ||
// SOQL query inside a loop - bad practice | ||
for (Id accId : new List<Id>{ accountId }) { | ||
Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; | ||
update acc; | ||
return acc; | ||
} | ||
return null; | ||
} | ||
|
||
public Account getAccDetails3(Id accountId) { | ||
// SOQL query inside a loop - bad practice | ||
for (Id accId : new List<Id>{ accountId }) { | ||
Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; | ||
update acc; | ||
return acc; | ||
} | ||
return null; | ||
} | ||
|
||
// This method lacks ApexDocs | ||
public void UpdateAccount(List<Account> accounts) { | ||
// DML operation inside a loop - bad practice | ||
for (Account acc : accounts) { | ||
acc.Name += ' - Updated'; | ||
update acc; // This should be done in bulk outside the loop | ||
} | ||
} | ||
|
||
/** | ||
* Deletes a specified account | ||
* @param accountId The ID of the account to be deleted | ||
*/ | ||
public void delete_Account(Id accountId) { | ||
// Hardcoding IDs - bad practice | ||
Id hardCodedId = '001xx000003DGAXAA4'; | ||
delete [SELECT Id FROM Account WHERE Id = :hardCodedId]; | ||
} | ||
|
||
// This method lacks ApexDocs | ||
public List<Account> ListAccounts() { | ||
// Not using bulkified approach - bad practice | ||
List<Account> accounts = [SELECT Id, Name FROM Account LIMIT 1]; | ||
return accounts; | ||
} | ||
|
||
/** | ||
* Calculates the annual revenue | ||
* - This ApexDoc is incomplete and lacks parameter description | ||
* @return Decimal The calculated annual revenue | ||
*/ | ||
public String CalculateAnnualRevenue() { | ||
// Lack of null checks and exception handling - bad practice | ||
Account acc = [ | ||
SELECT Industry | ||
FROM Account | ||
WHERE Id = '001xx000003DGAZAA4' | ||
]; | ||
return acc.Industry; | ||
} | ||
|
||
// This method lacks ApexDocs | ||
public List<Account> ListAccounts2() { | ||
// Not using bulkified approach - bad practice | ||
List<Account> accounts = [SELECT Id, Name FROM Account LIMIT 1]; | ||
return accounts; | ||
} | ||
|
||
// This method lacks ApexDocs | ||
public List<Account> ListAccounts3() { | ||
// Not using bulkified approach - bad practice | ||
List<Account> accounts = [SELECT Id, Name FROM Account LIMIT 1]; | ||
return accounts; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>59.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
Oops, something went wrong.