private convertRawResults()

in src/axe-raw-sarif-converter.ts [97:137]


    private convertRawResults(
        results: AxeRawResult[],
        ruleIdsToRuleIndices: DictionaryStringTo<number>,
        environmentData: EnvironmentData,
    ): Sarif.Result[] {
        const resultArray: Sarif.Result[] = [];

        for (const result of results) {
            const axeRawNodeResultArrays = [
                result.violations,
                result.passes,
                result.incomplete,
                result.inapplicable,
            ];

            for (const axeRawNodeResultArray of axeRawNodeResultArrays) {
                if (!axeRawNodeResultArray) {
                    continue;
                }
                resultArray.push(
                    ...this.convertRawNodeResults(
                        axeRawNodeResultArray,
                        ruleIdsToRuleIndices,
                        environmentData,
                        result.id,
                    ),
                );
            }
            if (axeRawNodeResultArrays.every(isEmpty)) {
                resultArray.push(
                    this.generateResultForInapplicableRule(
                        ruleIdsToRuleIndices,
                        result.id,
                        result.description,
                    ),
                );
            }
        }

        return resultArray;
    }