packages/formatter-html/src/assets/js/scan/scanner-common.js
function (element, closeAll) {
        var expanded = typeof closeAll !== 'undefined' ? closeAll : childRulesExpanded(element);

        if (expanded) {
            element.textContent = 'close all';
            element.classList.remove('closed');
            element.classList.add('expanded');
        } else {
            element.textContent = 'expand all';
            element.classList.remove('expanded');
            element.classList.add('closed');
        }
    }
function (element, closeAll) {
        var expanded = typeof closeAll !== 'undefined' ? closeAll : childRulesExpanded(element);

        if (expanded) {
            element.textContent = 'close all';
            element.classList.remove('closed');
            element.classList.add('expanded');
        } else {
            element.textContent = 'expand all';
            element.classList.remove('expanded');
            element.classList.add('closed');
        }
    }
function ( element , closeAll ) { var expanded = typeof closeAll !== 'undefined' ? closeAll : childRulesExpanded ( element ) ; if ( expanded ) { element . textContent = 'close all' ; element . classList . remove ( 'closed' ) ; element . classList . add ( 'expanded' ) ; } else { element . textContent = 'expand all' ; element . classList . remove ( 'expanded' ) ; element . classList . add ( 'closed' ) ; } }
if all rules are closed, toggle button to 'expand all'.
if any rule is open, toggle button to 'close all'.
if all rules are closed toggle button to expand all . if any rule is open toggle button to close all .