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

Feature/review #36

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .github/workflows/build.yml

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ on:
jobs:
review:
name: ReviewSource
runs-on: 'ubuntu-latest'
runs-on: ubuntu-latest
steps:
- name: Code Review
uses: packocz/sfdx-code-review-action@master
uses: pragmatic-bear/sfdx-code-review-action@v0.5.1
with:
source_path: 'invest-app/**/*'
reject_threshold: 1
approve_threshold: 3
category: '!Documentation'
github_token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions invest-app/main/default/classes/InvestmentStatisticsJob.cls
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ public with sharing class InvestmentStatisticsJob implements Database.Batchable<
this.startDate = startDate;
this.investmentIds = investmentIds;
}


public List<Investment__c> start(Database.BatchableContext bc) {
return [SELECT Id FROM Investment__c WHERE Id IN :this.investmentIds];
}

public void execute(Database.BatchableContext bc, List<Investment__c> scope) {
for (Investment__c investment : scope) {
InvestmentStatisticsService stats = new InvestmentStatisticsService(investment.Id, this.startDate);
stats.process();
stats.save();
}
}

public void finish(Database.BatchableContext bc) {
Copy link

Choose a reason for hiding this comment

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

Avoid empty block statements. (pmd - EmptyStatementBlock - Severity: 3)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public with sharing class InvestmentStatisticsService {

Decimal previousTotal;
while (weekNumber <= lastWeekNumber) {
System.debug('test');
Copy link

Choose a reason for hiding this comment

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

Avoid debug statements since they impact on performance (pmd - AvoidDebugStatements - Severity: 3)

Copy link

Choose a reason for hiding this comment

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

Calls to System.debug should specify a logging level. (pmd - DebugsShouldUseLoggingLevel - Severity: 3)

InvestmentSnapshot__c thisWeek = this.snapshots.containsKey(weekNumber)
? this.snapshots.get(weekNumber)
: new InvestmentSnapshot__c(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
public without sharing class TA_InvestmentUpdate_SetCurrency implements packocz.TriggerAction.BeforeInsert {
@namespaceAccessible
public void beforeInsert(List<InvestmentUpdate__c> newList) {

Choose a reason for hiding this comment

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

Source Type: TA_InvestmentUpdate_SetCurrency, Source Method: beforeInsert, Sink File: invest-app/main/default/classes/TA_InvestmentUpdate_SetCurrency.cls: 11 ### FLS validation is missing for [READ] operation on [Investment__c] with field(s) [CurrencyIsoCode]. (sfge - ApexFlsViolationRule - Severity: 1)

System.debug('test');

Choose a reason for hiding this comment

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

Avoid debug statements since they impact on performance (pmd - AvoidDebugStatements - Severity: 3)

Choose a reason for hiding this comment

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

Calls to System.debug should specify a logging level. (pmd - DebugsShouldUseLoggingLevel - Severity: 3)

Set<Id> investmentIds = new Set<Id>();
for (InvestmentUpdate__c iu : newList) {
investmentIds.add(iu.Investment__c);
Expand Down
1 change: 1 addition & 0 deletions invest-app/main/default/triggers/InvestmentUpdate.trigger
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
trigger InvestmentUpdate on InvestmentUpdate__c(before insert, after insert, after update, after delete) {
System.debug('test');

Choose a reason for hiding this comment

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

Avoid debug statements since they impact on performance (pmd - AvoidDebugStatements - Severity: 3)

Choose a reason for hiding this comment

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

Calls to System.debug should specify a logging level. (pmd - DebugsShouldUseLoggingLevel - Severity: 3)

new packocz.MetadataTriggerHandler().run();
}
Loading
Loading