You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I think, this is a very useful functionality, but code quality could be increased.
We run a quality scan on this provided code and I would like to share the result here with everyone:
force-app/main/default/classes/BatchJobBase.cls
3 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
Avoid using if statements without curly braces
Line 18
Code Smell
Major
2min effort
force-app/main/default/classes/BatchJobHelper.cls
5 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Line 11
Code Smell
Major
5min effort
Permissions should be checked before accessing resource asyncapexjob.
Line 20 Vulnerability
Major
30min effort
Permissions should be checked before accessing resource Batch_Job_Log__c.
Line 34 Vulnerability
Major
30min effort
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Line 35
Code Smell
Major
15min effort
New exception is thrown in catch block, original stack trace may be lost
Line 36
Bug
Major
10min effort
Permissions should be checked before accessing resource Batch_Job_Log__c.
Line 48 Vulnerability
Major
30min effort
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Line 49
Code Smell
Major
15min effort
New exception is thrown in catch block, original stack trace may be lost
Line 50
Bug
Major
10min effort
force-app/main/default/classes/BatchJobScheduler.cls
16 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
Avoid using if statements without curly braces
Line 23
Code Smell
Major
2min effort
Avoid running Soql and DML inside loops.
Line 30
Code Smell
Major
15min effort
Deeply nested if..then statements are hard to read
Line 47
Code Smell
Major
10min effort
Avoid running Soql and DML inside loops.
Line 49
Code Smell
Major
15min effort
Permissions should be checked before accessing resource batch_apex_job__c.
Line 62 Vulnerability
Major
30min effort
Avoid using if statements without curly braces
Line 72
Code Smell
Major
2min effort
Avoid using for statements without curly braces
Line 91
Code Smell
Major
2min effort
Avoid running Soql and DML inside loops. Loop Trace : BatchJobScheduler.hasPendingJobs: line 94 --> BatchJobScheduler.executeNextJob: line 42
Line 94
Code Smell
Major
15min effort
Permissions should be checked before accessing resource asyncapexjob.
Line 94 Vulnerability
Major
30min effort
Avoid confusing if (x != y) ..; else ..; logic
Line 100
Code Smell
Major
10min effort
Avoid unnecessary if..then..else statements when returning booleans
Line 100
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 101
Code Smell
Major
2min effort
Methods should only have 1 return statements.
Line 101
Code Smell
Major
20min effort
Avoid using if...else statements without curly braces
Line 103
Code Smell
Major
2min effort
Avoid confusing if (x != y) ..; else ..; logic
Line 111
Code Smell
Major
10min effort
Avoid using if...else statements without curly braces
Line 112
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 114
Code Smell
Major
2min effort
force-app/main/default/classes/BatchJobSchedulerTest.cls
21 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 12
Code Smell
Major
2min effort
Avoid making queries which dont limit the results
Line 45
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 61
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 72
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 82
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 95
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 108
Code Smell
Major
15min effort
force-app/main/default/classes/GlobalConstants.cls
3 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 20
Code Smell
Major
2min effort
Each class should declare at least one constructor
Line 20
Code Smell
Major
5min effort
public static fields should be constant
Line 22
Code Smell
Major
30min effort
public static fields should be constant
Line 23
Code Smell
Major
30min effort
public static fields should be constant
Line 24
Code Smell
Major
30min effort
public static fields should be constant
Line 25
Code Smell
Major
30min effort
public static fields should be constant
Line 26
Code Smell
Major
30min effort
public static fields should be constant
Line 27
Code Smell
Major
30min effort
public static fields should be constant
Line 28
Code Smell
Major
30min effort
force-app/main/default/classes/ScheduledApexJob.cls
3 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 12
Code Smell
Major
2min effort
force-app/main/default/classes/SchedulerConfigurationController.cls
18 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 13
Code Smell
Major
2min effort
Controller variable could be declared transient
Line 15
Code Smell
Major
10min effort
Controller variable could be declared transient
Line 17
Code Smell
Major
10min effort
Avoid unused local variables such as 'scheduledApexJobs'.
Line 21
Code Smell
Major
5min effort
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Line 31
Code Smell
Major
15min effort
Avoid unused local variables such as 'scheduler'.
Line 41
Code Smell
Major
5min effort
Assigning an Object to null is a code smell. Consider refactoring.
Line 53
Code Smell
Major
2min effort
Permissions should be checked before accessing resource Batch_Job_Schedule__c.
Line 60 Vulnerability
Major
30min effort
Avoid using if statements without curly braces
Line 76
Code Smell
Major
2min effort
Permissions should be checked before accessing resource crontrigger.
Line 85 Vulnerability
Major
30min effort
Avoid using if statements without curly braces
Line 99
Code Smell
Major
2min effort
Permissions should be checked before accessing resource batch_job_schedule__c.
Line 103 Vulnerability
Major
30min effort
Avoid using if...else statements without curly braces
Line 114
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 116
Code Smell
Major
2min effort
Methods should only have 1 return statements.
Line 134
Code Smell
Major
20min effort
force-app/main/default/classes/SchedulerConfigurationControllerTest.cls
11 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 12
Code Smell
Major
2min effort
force-app/main/default/classes/SchedulerCronExpressionHandler.cls
8 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Line 11
Code Smell
Major
5min effort
Avoid using if...else statements without curly braces
Line 16
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 20
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 25
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 30
Code Smell
Major
2min effort
Avoid using if statements without curly braces
Line 35
Code Smell
Major
2min effort
force-app/main/default/classes/SchedulerCronExpressionHandlerTest.cls
25 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
Avoid making queries which dont limit the results
Line 27
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 45
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 63
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 82
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 101
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 117
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 135
Code Smell
Major
15min effort
force-app/main/default/classes/SchedulerCronTriggerHandler.cls
6 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Line 11
Code Smell
Major
5min effort
With Sharing or Inherited Sharing should be used on classes that make use of DML. First usage on line 40
Line 11 Vulnerability
Major
15min effort
Avoid using if statements without curly braces
Line 18
Code Smell
Major
2min effort
These nested if statements could be combined
Line 28
Code Smell
Major
5min effort
Assigning an Object to null is a code smell. Consider refactoring.
Line 29
Code Smell
Major
2min effort
Avoid using for statements without curly braces
Line 40
Code Smell
Major
2min effort
Permissions should be checked before accessing resource crontrigger.
Line 40 Vulnerability
Major
30min effort
force-app/main/default/pages/SchedulerConfiguration.page
CSRF protection on GET requests must be enabled
Line 1
Code Smell
Major
15min effort
Insert a header comment before this tag.
Line 1
Code Smell
Major
5min effort
force-app/main/default/triggers/BatchJobScheduleTrigger.trigger
2 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
The text was updated successfully, but these errors were encountered:
Hi,
I think, this is a very useful functionality, but code quality could be increased.
We run a quality scan on this provided code and I would like to share the result here with everyone:
force-app/main/default/classes/BatchJobBase.cls
3 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
Avoid using if statements without curly braces
Line 18
Code Smell
Major
2min effort
force-app/main/default/classes/BatchJobHelper.cls
5 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Line 11
Code Smell
Major
5min effort
Permissions should be checked before accessing resource asyncapexjob.
Line 20
Vulnerability
Major
30min effort
Permissions should be checked before accessing resource Batch_Job_Log__c.
Line 34
Vulnerability
Major
30min effort
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Line 35
Code Smell
Major
15min effort
New exception is thrown in catch block, original stack trace may be lost
Line 36
Bug
Major
10min effort
Permissions should be checked before accessing resource Batch_Job_Log__c.
Line 48
Vulnerability
Major
30min effort
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Line 49
Code Smell
Major
15min effort
New exception is thrown in catch block, original stack trace may be lost
Line 50
Bug
Major
10min effort
force-app/main/default/classes/BatchJobScheduler.cls
16 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
Avoid using if statements without curly braces
Line 23
Code Smell
Major
2min effort
Avoid running Soql and DML inside loops.
Line 30
Code Smell
Major
15min effort
Deeply nested if..then statements are hard to read
Line 47
Code Smell
Major
10min effort
Avoid running Soql and DML inside loops.
Line 49
Code Smell
Major
15min effort
Permissions should be checked before accessing resource batch_apex_job__c.
Line 62
Vulnerability
Major
30min effort
Avoid using if statements without curly braces
Line 72
Code Smell
Major
2min effort
Avoid using for statements without curly braces
Line 91
Code Smell
Major
2min effort
Avoid running Soql and DML inside loops. Loop Trace : BatchJobScheduler.hasPendingJobs: line 94 --> BatchJobScheduler.executeNextJob: line 42
Line 94
Code Smell
Major
15min effort
Permissions should be checked before accessing resource asyncapexjob.
Line 94
Vulnerability
Major
30min effort
Avoid confusing if (x != y) ..; else ..; logic
Line 100
Code Smell
Major
10min effort
Avoid unnecessary if..then..else statements when returning booleans
Line 100
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 101
Code Smell
Major
2min effort
Methods should only have 1 return statements.
Line 101
Code Smell
Major
20min effort
Avoid using if...else statements without curly braces
Line 103
Code Smell
Major
2min effort
Avoid confusing if (x != y) ..; else ..; logic
Line 111
Code Smell
Major
10min effort
Avoid using if...else statements without curly braces
Line 112
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 114
Code Smell
Major
2min effort
force-app/main/default/classes/BatchJobSchedulerTest.cls
21 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 12
Code Smell
Major
2min effort
Avoid making queries which dont limit the results
Line 45
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 61
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 72
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 82
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 95
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 108
Code Smell
Major
15min effort
force-app/main/default/classes/GlobalConstants.cls
3 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 20
Code Smell
Major
2min effort
Each class should declare at least one constructor
Line 20
Code Smell
Major
5min effort
public static fields should be constant
Line 22
Code Smell
Major
30min effort
public static fields should be constant
Line 23
Code Smell
Major
30min effort
public static fields should be constant
Line 24
Code Smell
Major
30min effort
public static fields should be constant
Line 25
Code Smell
Major
30min effort
public static fields should be constant
Line 26
Code Smell
Major
30min effort
public static fields should be constant
Line 27
Code Smell
Major
30min effort
public static fields should be constant
Line 28
Code Smell
Major
30min effort
force-app/main/default/classes/ScheduledApexJob.cls
3 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 12
Code Smell
Major
2min effort
force-app/main/default/classes/SchedulerConfigurationController.cls
18 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 13
Code Smell
Major
2min effort
Controller variable could be declared transient
Line 15
Code Smell
Major
10min effort
Controller variable could be declared transient
Line 17
Code Smell
Major
10min effort
Avoid unused local variables such as 'scheduledApexJobs'.
Line 21
Code Smell
Major
5min effort
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block
Line 31
Code Smell
Major
15min effort
Avoid unused local variables such as 'scheduler'.
Line 41
Code Smell
Major
5min effort
Assigning an Object to null is a code smell. Consider refactoring.
Line 53
Code Smell
Major
2min effort
Permissions should be checked before accessing resource Batch_Job_Schedule__c.
Line 60
Vulnerability
Major
30min effort
Avoid using if statements without curly braces
Line 76
Code Smell
Major
2min effort
Permissions should be checked before accessing resource crontrigger.
Line 85
Vulnerability
Major
30min effort
Avoid using if statements without curly braces
Line 99
Code Smell
Major
2min effort
Permissions should be checked before accessing resource batch_job_schedule__c.
Line 103
Vulnerability
Major
30min effort
Avoid using if...else statements without curly braces
Line 114
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 116
Code Smell
Major
2min effort
Methods should only have 1 return statements.
Line 134
Code Smell
Major
20min effort
force-app/main/default/classes/SchedulerConfigurationControllerTest.cls
11 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 12
Code Smell
Major
2min effort
force-app/main/default/classes/SchedulerCronExpressionHandler.cls
8 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Line 11
Code Smell
Major
5min effort
Avoid using if...else statements without curly braces
Line 16
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 20
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 25
Code Smell
Major
2min effort
Avoid using if...else statements without curly braces
Line 30
Code Smell
Major
2min effort
Avoid using if statements without curly braces
Line 35
Code Smell
Major
2min effort
force-app/main/default/classes/SchedulerCronExpressionHandlerTest.cls
25 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
Avoid making queries which dont limit the results
Line 27
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 45
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 63
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 82
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 101
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 117
Code Smell
Major
15min effort
Avoid making queries which dont limit the results
Line 135
Code Smell
Major
15min effort
force-app/main/default/classes/SchedulerCronTriggerHandler.cls
6 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Line 11
Code Smell
Major
5min effort
With Sharing or Inherited Sharing should be used on classes that make use of DML. First usage on line 40
Line 11
Vulnerability
Major
15min effort
Avoid using if statements without curly braces
Line 18
Code Smell
Major
2min effort
These nested if statements could be combined
Line 28
Code Smell
Major
5min effort
Assigning an Object to null is a code smell. Consider refactoring.
Line 29
Code Smell
Major
2min effort
Avoid using for statements without curly braces
Line 40
Code Smell
Major
2min effort
Permissions should be checked before accessing resource crontrigger.
Line 40
Vulnerability
Major
30min effort
force-app/main/default/pages/SchedulerConfiguration.page
CSRF protection on GET requests must be enabled
Line 1
Code Smell
Major
15min effort
Insert a header comment before this tag.
Line 1
Code Smell
Major
5min effort
force-app/main/default/triggers/BatchJobScheduleTrigger.trigger
2 more comment lines need to be written to reach the minimum threshold of 25.0% comment density.
Line 11
Code Smell
Major
2min effort
The text was updated successfully, but these errors were encountered: