smalos / nubuilder_dev

Found unsafe function declarations JS-0073
Bug risk
Major
5 occurrences in this check
Function declared in a loop contains unsafe references to variable(s) 'nuFORM', 'event'.
  64  for (let i = 0; i < flds.length; i++) {
  65    $(flds[i])
  66      .addClass('nuScroll')
  67      .keydown(function () {  68        nuFORM.scrollList(event, l)  69      })  70  }
  71}
  72
Function declared in a loop contains unsafe references to variable(s) '$', 'i', '$'.
4546  for (var i = 0; i < c.length; i++) {
4547    if (c[i].subform) {
4548      $('#' + c[i].id + 'scrollDiv' + ' > .nuSubform1').remove()
4549      $('#' + c[i].id + 'scrollDiv' + ' > .nuSubform0').each(function () {4550        if ($(this)[0].id != c[i].id + '000nuRECORD') {4551          $(this).remove()4552        }4553      })4554
4555      const k = $('#' + c[i].id + '000nuRECORD').children()
4556
Function declared in a loop contains unsafe references to variable(s) '$', 'i', '$', 'i', 'nuSetSearchColumn'.
4852      .attr('onclick', 'nuClickSearchColumn(event);')
4853      .addClass('nuOptionsItem')
4854      .html(nobr)
4855      .click(function () {4856        const cb = $('#nuSearchList' + i).attr('checked')48574858        $('#' + 'nuSearchList' + i).attr('checked', !cb)48594860        nuSetSearchColumn()4861      })4862
4863    if (i < 9) {
4864      const shortcut_key = document.createElement('div')
Function declared in a loop contains unsafe references to variable(s) 'nuBuildLookup'.
1028        .prop('disabled', false)
1029
1030      if (c === 2) { // -- button
1031        $current.on('click', () => nuBuildLookup(components[c], ''))1032      }
1033    }
1034  })
Function declared in a loop contains unsafe references to variable(s) 'length', 'isEmpty'.
1466
1467        if (arr.length > settings.maxArray) {
1468          for (var i = 0, length = arr.length; i < length; i += settings.maxArray) {
1469            (function (i) {1470              const until = Math.min(i + settings.maxArray, length)1471              table.addRow([1472                i + '..' + (until - 1),1473                util.expander(1474                  '[EXPAND]',1475                  'Click to show items from this slice',1476                  function () {1477                    const obj = {}1478                    for (let j = i; j < until; j++) {1479                      obj[j] = arr[j]1480                    }1481                    try {1482                      const child = prettyPrintThis(obj, {1483                        maxDepth: 11484                      })1485                      child.getElementsByTagName('th')[0].style.display = 'none'1486                      this.parentNode.appendChild(child)1487                    } catch (e) {1488                      this.parentNode.appendChild(1489                        util.table(['ERROR OCCURED DURING OBJECT RETRIEVAL'], 'error').addRow([e.message]).node)1490                    }1491                  })1492              ])1493              isEmpty = false1494            })(i)1495          }
1496        } else {
1497          util.forEach(arr, function (item, index) {