Skip to content

Commit 6e172c0

Browse files
authored
Reduce False Positives for Plugin Errors (#133)
* reduce false positives for plugin errors * adjust code cov threshold to 95%
1 parent 02e99ec commit 6e172c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ jobs:
203203
# Parse the JSON coverage summary file to extract overall coverage percentage
204204
COVERAGE_PERCENT=$(cat coverage/coverage/coverage-summary.json | jq -r '.total.lines.pct')
205205
echo "Code coverage: ${COVERAGE_PERCENT}%"
206-
if [ "$COVERAGE_PERCENT" != "100" ]; then
207-
echo "❌ Code coverage is ${COVERAGE_PERCENT}%, but 100% is required"
206+
if (( $(echo "$COVERAGE_PERCENT < 95" | bc -l) )); then
207+
echo "❌ Code coverage is ${COVERAGE_PERCENT}%, but 95% or higher is required"
208208
exit 1
209209
fi
210210

source/classes/DatabaseLayerUtils.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public without sharing class DatabaseLayerUtils {
123123
String className;
124124
try {
125125
className = (String) DatabaseLayer.Utils?.Settings?.get(field);
126-
return Type.forName(className)?.newInstance();
126+
return (className != null) ? Type.forName(className)?.newInstance() : null;
127127
} catch (Exception error) {
128128
String source = DatabaseLayerUtils.Plugin.class.getName();
129129
String msg = source + ': Invalid ' + field + ': "' + className + '". Details: ' + error;

0 commit comments

Comments
 (0)