smalos / nubuilder_dev

Initialization in variable declarations against recommended approach JS-0119
Anti-pattern
Minor
14 occurrences in this check
Variable 's' should be initialized on declaration.
5335  const p = cf.pages 								// Total number of pages
5336
5337  let e 												// Row number of the last record on the current page
5338  let s 												// Row number of the first record on the current page5339
5340  if (c == 0 && f > 0 && p == 1) {
5341    s = 1
Variable 'e' should be initialized on declaration.
5334  const f = cf.browse_filtered_rows 					// Number of records in the table after filtering
5335  const p = cf.pages 								// Total number of pages
5336
5337  let e 												// Row number of the last record on the current page5338  let s 												// Row number of the first record on the current page
5339
5340  if (c == 0 && f > 0 && p == 1) {
Variable 'firstCellClass' should be initialized on declaration.
3648
3649    if (brCount == 0 && r > 0) {
3650      let noData
3651      let firstCellClass3652
3653      const $firstCell = $('#nucell_0_0')
3654
Variable 'noData' should be initialized on declaration.
3647    t = t + h + 7
3648
3649    if (brCount == 0 && r > 0) {
3650      let noData3651      let firstCellClass
3652
3653      const $firstCell = $('#nucell_0_0')
Variable 'borderRight' should be initialized on declaration.
3636  let t = parseInt($('#nuBrowseTitle0').css('height'), 10) - h - 2
3637  let l = 7
3638  let borderLeft
3639  let borderRight3640
3641  const brCount = bc.browse_rows
3642  const $record = $('#nuRECORD')
Variable 'borderLeft' should be initialized on declaration.
3635  let h = bc.row_height
3636  let t = parseInt($('#nuBrowseTitle0').css('height'), 10) - h - 2
3637  let l = 7
3638  let borderLeft3639  let borderRight
3640
3641  const brCount = bc.browse_rows
Variable 'cb' should be initialized on declaration.
2459}
2460
2461function nuGetClipboardText (e) {
2462  let cb2463  let clipText = ''
2464  if (window.clipboardData && window.clipboardData.getData) {
2465    cb = window.clipboardData
Variable 'obj' should be initialized on declaration.
2216  }
2217
2218  function nuSubformFilterAddObject (type, sfName, columnId, filterId, prop) {
2219    let obj2220    if (type == 'select') {
2221      obj = nuSubformFilterAddSelect(sfName, columnId, filterId, prop)
2222    } else if (type === 'search') {
Variable 'result' should be initialized on declaration.
2122  const activeElement = $(document.activeElement)
2123  const nuScroll = activeElement.hasClass('nuScroll')
2124
2125  let result2126  switch (e.key) {
2127    case 'ArrowUp':
2128      result = !nuScroll && nuSubformMoveFocus(activeElement, -1)
Variable 'prefix' should be initialized on declaration.
1863  nuSUBFORMScrollDivAddCSS(id, SF, scrId, rowTop, rowWidth)
1864
1865  rowTop = 0
1866  let prefix1867
1868  for (let c = 0; c < subformRows.forms.length; c++) {
1869    prefix = id + nuPad3(c)
Variable 'obj2' should be initialized on declaration.
1297
1298  for (const key in arr) {
1299    if (Object.prototype.hasOwnProperty.call(arr, key)) {
1300      let obj21301      if (key == 'label') {
1302        obj2 = $('#' + 'label' + '_' + id)
1303      } else {
Variable 'value' should be initialized on declaration.
1256    attr.trim().replace(/\"/g, '').split(',').forEach(attr => {
1257      const arr = attr.split('=')
1258      let key
1259      let value1260
1261      if (arr.length == 2) {
1262        [key, value] = arr
Variable 'key' should be initialized on declaration.
1255  if (attr !== undefined && attr !== null && attr !== '') {
1256    attr.trim().replace(/\"/g, '').split(',').forEach(attr => {
1257      const arr = attr.split('=')
1258      let key1259      let value
1260
1261      if (arr.length == 2) {
Variable 'promot' should be initialized on declaration.
  35
  36nuInitJSOptions()
  37
  38let promot  39
  40function nuBuildForm (f) {
  41  window.nuOnSetSelect2Options = null