Skip to content

Conversation

@PabstMirror
Copy link
Collaborator

ref #1168

rough prototype
Will warn on mismatched else sides, (could also expand this to switch blocks)

private _data = if (alive _this) then { 1 } else { "They're dead" }; // warn

but will only report when the value is actually used

if (x) then {
    y pushBack 5
} else {
    z set ["key", value] // technically different types but not used, so no problem
};

but I'm seeing just a few valid uses that trigger this
ace has


        // check if replacement is for item type or class name
        private _configName = configName _x;
        private _toReplace = if ((_configName select [0,9]) == "ItemType_") then {
            parseNumber (_configName select [9])
        } else {
            _configName
        };
        // screenLocation [ARRAY or STRING] - Optional (will be converted to ARRAY here!)
        private _screenLocation = if (isArray (_x >> "screenLocation")) then {
            getArray (_x >> "screenLocation") // modelOffset
        } else {
            getText (_x >> "screenLocation") // memPoint
        };

cba has

#define RETDEF(VARIABLE,DEFAULT_VALUE) (if (isNil {VARIABLE}) then [{DEFAULT_VALUE}, {VARIABLE}])
#define RETNIL(VARIABLE) RETDEF(VARIABLE,nil)
(if (isNil {missionVersion}) then [{nil}, {missionVersion}])

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

❌ Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.0%. Comparing base (22fcb71) to head (824f1b2).

Files with missing lines Patch % Lines
libs/sqf/src/analyze/inspector/commands.rs 92.5% 2 Missing ⚠️
libs/sqf/src/analyze/inspector/game_value.rs 84.6% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
libs/sqf/src/analyze/inspector/mod.rs 96.8% <100.0%> (ø)
libs/sqf/src/analyze/inspector/commands.rs 86.9% <92.5%> (+2.5%) ⬆️
libs/sqf/src/analyze/inspector/game_value.rs 77.5% <84.6%> (+0.3%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants