app/js/renderer/bw/export.js   A
last analyzed

Complexity

Total Complexity 7
Complexity/F 1

Size

Lines of Code 91
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 40
mnd 0
bc 0
fnc 7
dl 0
loc 91
rs 10
bpm 0
cpm 1
noi 9
c 0
b 0
f 0
1
// jshint esversion: 8
2
3
const whois = require('../../common/whoisWrapper'),
0 ignored issues
show
Unused Code introduced by
The constant whois seems to be never used. Consider removing it.
Loading history...
4
  conversions = require('../../common/conversions'),
0 ignored issues
show
Unused Code introduced by
The constant conversions seems to be never used. Consider removing it.
Loading history...
5
  defaultExportOptions = require('./export.defaults');
0 ignored issues
show
Unused Code introduced by
The constant defaultExportOptions seems to be never used. Consider removing it.
Loading history...
6
7
const {
8
  ipcRenderer
9
} = require('electron'), {
10
  resetObject
11
} = require('../../common/resetObject'), {
12
  getExportOptions,
13
  setExportOptions,
14
  setExportOptionsEx
15
} = require('./auxiliary');
16
17
require('../../common/stringFormat');
18
19
var results, options;
20
21
/*
22
  ipcRenderer.on('bw:result.receive', function(...) {...});
23
    ipsum
24
  parameters
25
    event
26
    rcvResults
27
 */
28
ipcRenderer.on('bw:result.receive', function(event, rcvResults) {
29
  ipcRenderer.send('app:debug', "Results are ready for export {0}".format(rcvResults));
30
31
  results = rcvResults;
32
  //console.log("%o", results);
33
34
  return;
0 ignored issues
show
Unused Code introduced by
This return has no effect and can be removed.
Loading history...
35
});
36
37
/*
38
  ipcRenderer.on('bw:export.cancel', function() {...});
39
    Bulk whois export cancel
40
 */
41
ipcRenderer.on('bw:export.cancel', function() {
42
  $('#bwExportloading').addClass('is-hidden');
43
  $('#bwEntry').removeClass('is-hidden');
44
45
  return;
0 ignored issues
show
Unused Code introduced by
This return has no effect and can be removed.
Loading history...
46
});
47
48
/*
49
  $('#bwExportButtonExport').click(function() {...});
50
    Bulk whois export confirm
51
 */
52
$('#bwExportButtonExport').click(function() {
53
  $('#bwExport').addClass('is-hidden');
54
  options = getExportOptions();
55
  $.when($('#bwExportloading').removeClass('is-hidden').delay(10)).done(function() {
56
    ipcRenderer.send("bw:export", results, options);
57
  });
58
59
  return;
0 ignored issues
show
Unused Code introduced by
This return has no effect and can be removed.
Loading history...
60
});
61
62
/*
63
  $('#bwExportButtonCancel').click(function() {...});
64
    Export options, cancel export
65
 */
66
$('#bwExportButtonCancel').click(function() {
67
  $('#bwExport').addClass('is-hidden');
68
  $('#bwEntry').removeClass('is-hidden');
69
70
  return;
0 ignored issues
show
Unused Code introduced by
This return has no effect and can be removed.
Loading history...
71
});
72
73
/*
74
  $('#bwExportSelectPreset').change(function() {...});
75
    ipsum
76
 */
77
$('#bwExportSelectPreset').change(function() {
78
  var preset = $('#bwExportSelectPreset').val();
79
  setExportOptions(preset);
80
81
  return;
0 ignored issues
show
Unused Code introduced by
This return has no effect and can be removed.
Loading history...
82
});
83
84
/*
85
  $('#bwExportSelectFiletype').change(function() {...});
86
    ipsum
87
 */
88
$('#bwExportSelectFiletype').change(function() {
89
  var filetype = $('#bwExportSelectFiletype').val();
90
  setExportOptionsEx(filetype);
91
92
  return;
0 ignored issues
show
Unused Code introduced by
This return has no effect and can be removed.
Loading history...
93
});
94