Passed
Pull Request — master (#57)
by Salim
19:50
created

src/ohif/ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js   F

Complexity

Total Complexity 232
Complexity/F 1.67

Size

Lines of Code 738
Function Count 139

Duplication

Duplicated Lines 509
Ratio 68.97 %

Importance

Changes 0
Metric Value
eloc 461
c 0
b 0
f 0
dl 509
loc 738
rs 2
wmc 232
mnd 93
bc 93
fnc 139
bpm 0.669
cpm 1.669
noi 83

62 Functions

Rating   Name   Duplication   Size   Complexity  
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ getLoader 8 8 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ loadFile 1 1 1
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_assertThisInitialized 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_inherits 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_setPrototypeOf 1 1 2
B ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _callee 38 38 5
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _nonIterableSpread 1 1 1
D ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ render 0 78 13
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _setPrototypeOf 0 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_inherits 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_defineProperty 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _defineProperty 0 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _extends 0 1 5
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _arrayWithoutHoles 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ pdfFileLoader_defineProperties 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_defineProperties 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _asyncToGenerator 0 1 5
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _temp 17 17 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ processFile 3 3 1
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _possibleConstructorReturn 0 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ getDefaultStudy 35 35 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_defineProperties 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_getPrototypeOf 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _createClass 0 1 3
B ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _objectSpread 1 1 7
B ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ getStudyFromDataset 52 52 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_defineProperty 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_classCallCheck 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _defineProperties 0 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ pdfFileLoader_classCallCheck 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_typeof 1 1 5
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _toConsumableArray 1 1 1
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _assertThisInitialized 0 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_createClass 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ ownKeys 1 1 4
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ getDataset 1 1 1
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_getPrototypeOf 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _inherits 0 1 3
B ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ groupSeries 30 30 6
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_setPrototypeOf 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _typeof 0 1 5
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_possibleConstructorReturn 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ FileLoader 5 5 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_assertThisInitialized 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ getStudies 1 1 1
B ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ ViewerLocalFileData 0 42 6
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ pdfFileLoader_defineProperty 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _iterableToArray 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_possibleConstructorReturn 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _getPrototypeOf 0 1 3
B ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _filesToStudies 26 26 5
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ _classCallCheck 0 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ FileLoaderService 16 16 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ filesToStudies 3 3 1
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dropZoneLinkDialog 0 15 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_classCallCheck 1 1 2
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ dicomFileLoader_typeof 1 1 5
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ addFile 3 3 1
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ linksDialogMessage 0 3 1
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ asyncGeneratorStep 0 1 4
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ pdfFileLoader_createClass 1 1 3
A ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js ➔ fileLoaderService_createClass 1 1 3

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complexity

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like src/ohif/ViewerLocalFileData.bundle.2ffc61b02a58172b9d2a.js often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[6],{
2
3
/***/ 939:
4
/***/ (function(module, __webpack_exports__, __webpack_require__) {
5
6
"use strict";
7
__webpack_require__.r(__webpack_exports__);
8
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
9
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
10
/* harmony import */ var _ohif_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84);
11
/* harmony import */ var _ohif_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(133);
12
/* harmony import */ var _ConnectedViewer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(960);
13
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
14
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
15
/* harmony import */ var _App_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(253);
16
/* harmony import */ var react_dropzone__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1005);
17
/* harmony import */ var _lib_filesToStudies__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(969);
18
/* harmony import */ var _ViewerLocalFileData_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(990);
19
/* harmony import */ var _ViewerLocalFileData_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_ViewerLocalFileData_css__WEBPACK_IMPORTED_MODULE_8__);
0 ignored issues
show
Unused Code introduced by
The variable _ViewerLocalFileData_css...RTED_MODULE_8___default seems to be never used. Consider removing it.
Loading history...
20
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(34);
21
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
0 ignored issues
show
Bug introduced by
The variable Symbol seems to be never declared. If this is a global, consider adding a /** global: Symbol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
22
23
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
24
25
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
26
27
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28
29
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
30
31
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
32
33
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
34
35
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
36
37
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
38
39
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
40
41
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
43
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
44
45
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
0 ignored issues
show
Complexity introduced by
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. _extends is already defined in line 45 as a function. While this will work, it can be very confusing.
Loading history...
46
47
48
49
50
51
52
53
54
55
56
var OHIFStudyMetadata = _ohif_core__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].OHIFStudyMetadata;
57
var studyMetadataManager = _ohif_core__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].studyMetadataManager;
58
59
var dropZoneLinkDialog = function dropZoneLinkDialog(onDrop, i18n, dir) {
60
  return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_dropzone__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
61
    onDrop: onDrop,
62
    noDrag: true
63
  }, function (_ref) {
64
    var getRootProps = _ref.getRootProps,
65
        getInputProps = _ref.getInputProps;
66
    return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", _extends({}, getRootProps(), {
67
      className: "link-dialog"
68
    }), dir ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, i18n('Load folders'), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", _extends({}, getInputProps(), {
69
      webkitdirectory: "true",
70
      mozdirectory: "true"
71
    }))) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, i18n('Load files'), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", getInputProps())));
72
  });
73
};
74
75
var linksDialogMessage = function linksDialogMessage(onDrop, i18n) {
76
  return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, i18n('Or click to '), dropZoneLinkDialog(onDrop, i18n), i18n(' or '), dropZoneLinkDialog(onDrop, i18n, true), i18n(' from dialog'));
77
};
78
79
var ViewerLocalFileData =
80
/*#__PURE__*/
81
function (_Component) {
82
  _inherits(ViewerLocalFileData, _Component);
83
84
  function ViewerLocalFileData() {
85
    var _getPrototypeOf2;
86
87
    var _this;
88
89
    _classCallCheck(this, ViewerLocalFileData);
90
91
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
0 ignored issues
show
Coding Style Best Practice introduced by
Using the Array constructor is generally discouraged. Consider using an array literal instead.
Loading history...
92
      args[_key] = arguments[_key];
93
    }
94
95
    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ViewerLocalFileData)).call.apply(_getPrototypeOf2, [this].concat(args)));
96
97
    _defineProperty(_assertThisInitialized(_this), "state", {
98
      studies: null,
99
      loading: false,
100
      error: null
101
    });
102
103
    _defineProperty(_assertThisInitialized(_this), "updateStudies", function (studies) {
104
      // Render the viewer when the data is ready
105
      studyMetadataManager.purge(); // Map studies to new format, update metadata manager?
106
107
      var updatedStudies = studies.map(function (study) {
108
        var studyMetadata = new OHIFStudyMetadata(study, study.StudyInstanceUID);
109
        var sopClassHandlerModules = _App_js__WEBPACK_IMPORTED_MODULE_5__[/* extensionManager */ "c"].modules['sopClassHandlerModule'];
110
        study.displaySets = study.displaySets || studyMetadata.createDisplaySets(sopClassHandlerModules);
111
        studyMetadata.setDisplaySets(study.displaySets);
112
        studyMetadata.forEachDisplaySet(function (displayset) {
113
          displayset.localFile = true;
114
        });
115
        studyMetadataManager.add(studyMetadata);
116
        return study;
117
      });
118
119
      _this.setState({
120
        studies: updatedStudies
121
      });
122
    });
123
124
    return _this;
125
  }
126
127
  _createClass(ViewerLocalFileData, [{
128
    key: "render",
129
    value: function render() {
130
      var _this2 = this;
131
132
      var onDrop =
133
      /*#__PURE__*/
134
      function () {
135
        var _ref2 = _asyncToGenerator(
136
        /*#__PURE__*/
137
        regeneratorRuntime.mark(function _callee(acceptedFiles) {
0 ignored issues
show
Bug introduced by
The variable regeneratorRuntime seems to be never declared. If this is a global, consider adding a /** global: regeneratorRuntime */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
138
          var studies, updatedStudies;
139
          return regeneratorRuntime.wrap(function _callee$(_context) {
0 ignored issues
show
Bug introduced by
The variable regeneratorRuntime seems to be never declared. If this is a global, consider adding a /** global: regeneratorRuntime */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
140
            while (1) {
141
              switch (_context.prev = _context.next) {
142
                case 0:
143
                  _this2.setState({
144
                    loading: true
145
                  });
146
147
                  _context.next = 3;
148
                  return Object(_lib_filesToStudies__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(acceptedFiles);
149
150
                case 3:
151
                  studies = _context.sent;
152
                  updatedStudies = _this2.updateStudies(studies);
0 ignored issues
show
Bug introduced by
The variable studies is changed as part of the while loop for example by _context.sent on line 151. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
153
154
                  if (updatedStudies) {
0 ignored issues
show
Bug introduced by
The variable updatedStudies is changed as part of the while loop for example by _this2.updateStudies(studies) on line 152. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
155
                    _context.next = 7;
156
                    break;
157
                  }
158
159
                  return _context.abrupt("return");
160
161
                case 7:
162
                  _this2.setState({
163
                    studies: updatedStudies,
0 ignored issues
show
Comprehensibility Bug introduced by
The variable updatedStudies does not seem to be initialized in case the while loop on line 140 is not entered. Are you sure this can never be the case?
Loading history...
164
                    loading: false
165
                  });
166
167
                case 8:
168
                case "end":
169
                  return _context.stop();
170
              }
171
            }
0 ignored issues
show
Best Practice introduced by
There is no return statement in this branch, but you do return something in other branches. Did you maybe miss it? If you do not want to return anything, consider adding return undefined; explicitly.
Loading history...
172
          }, _callee);
173
        }));
174
175
        return function onDrop(_x) {
0 ignored issues
show
Unused Code introduced by
The parameter _x is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
176
          return _ref2.apply(this, arguments);
177
        };
178
      }();
179
180
      if (this.state.error) {
181
        return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "Error: ", JSON.stringify(this.state.error));
182
      }
183
184
      return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_dropzone__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
185
        onDrop: onDrop,
186
        noClick: true
187
      }, function (_ref3) {
188
        var getRootProps = _ref3.getRootProps,
189
            getInputProps = _ref3.getInputProps;
0 ignored issues
show
Unused Code introduced by
The assignment to variable getInputProps seems to be never used. Consider removing it.
Loading history...
190
        return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", _extends({}, getRootProps(), {
191
          style: {
192
            width: '100%',
193
            height: '100%'
194
          }
195
        }), _this2.state.studies ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ConnectedViewer_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], {
196
          studies: _this2.state.studies,
197
          studyInstanceUIDs: _this2.state.studies && _this2.state.studies.map(function (a) {
198
            return a.StudyInstanceUID;
199
          })
200
        }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
201
          className: 'drag-drop-instructions'
202
        }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
203
          className: 'drag-drop-contents'
204
        }, _this2.state.loading ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h3", null, _this2.props.t('Loading...')) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h3", null, _this2.props.t('Drag and Drop DICOM files here to load them in the Viewer')), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", null, linksDialogMessage(onDrop, _this2.props.t))))));
205
      });
206
    }
207
  }]);
208
209
  return ViewerLocalFileData;
210
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
211
212
_defineProperty(ViewerLocalFileData, "propTypes", {
213
  studies: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.array
214
});
215
216
/* harmony default export */ __webpack_exports__["default"] = (Object(react_i18next__WEBPACK_IMPORTED_MODULE_9__[/* withTranslation */ "d"])('Common')(ViewerLocalFileData));
217
218
/***/ }),
219
220
/***/ 969:
221 View Code Duplication
/***/ (function(module, __webpack_exports__, __webpack_require__) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
222
223
"use strict";
224
225
// EXTERNAL MODULE: /home/salim/GaelO-Dev/OHIF/Viewers/node_modules/cornerstone-wado-image-loader/dist/cornerstoneWADOImageLoader.min.js
226
var cornerstoneWADOImageLoader_min = __webpack_require__(55);
227
var cornerstoneWADOImageLoader_min_default = /*#__PURE__*/__webpack_require__.n(cornerstoneWADOImageLoader_min);
228
229
// CONCATENATED MODULE: ./lib/localFileLoaders/fileLoader.js
230
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
231
232
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
233
234
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
235
236
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
237
238
var FileLoader =
239
/*#__PURE__*/
240
function () {
241
  function FileLoader() {
242
    _classCallCheck(this, FileLoader);
243
244
    _defineProperty(this, "fileType", void 0);
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
245
  }
246
247
  _createClass(FileLoader, [{
248
    key: "loadFile",
249
    value: function loadFile(file, imageId) {}
0 ignored issues
show
Unused Code introduced by
The parameter imageId is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter file is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
250
  }, {
251
    key: "getDataset",
252
    value: function getDataset(image, imageId) {}
0 ignored issues
show
Unused Code introduced by
The parameter imageId is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter image is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
253
  }, {
254
    key: "getStudies",
255
    value: function getStudies(dataset, imageId) {}
0 ignored issues
show
Unused Code introduced by
The parameter imageId is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter dataset is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
256
  }]);
257
258
  return FileLoader;
259
}();
260
261
262
// CONCATENATED MODULE: ./lib/localFileLoaders/pdfFileLoader.js
263
var pdfFileLoader_temp;
264
265
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
0 ignored issues
show
Bug introduced by
The variable Symbol seems to be never declared. If this is a global, consider adding a /** global: Symbol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
266
267
function pdfFileLoader_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
268
269
function pdfFileLoader_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
270
271
function pdfFileLoader_createClass(Constructor, protoProps, staticProps) { if (protoProps) pdfFileLoader_defineProperties(Constructor.prototype, protoProps); if (staticProps) pdfFileLoader_defineProperties(Constructor, staticProps); return Constructor; }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
272
273
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
274
275
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
276
277
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
278
279
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
280
281
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
282
283
function pdfFileLoader_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
284
285
286
287
var PDFFileLoader = new (pdfFileLoader_temp =
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
288
/*#__PURE__*/
289
function (_FileLoader) {
290
  _inherits(_temp, _FileLoader);
291
292
  function _temp() {
293
    var _getPrototypeOf2;
294
295
    var _this;
296
297
    pdfFileLoader_classCallCheck(this, _temp);
298
299
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
0 ignored issues
show
Coding Style Best Practice introduced by
Using the Array constructor is generally discouraged. Consider using an array literal instead.
Loading history...
300
      args[_key] = arguments[_key];
301
    }
302
303
    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(_temp)).call.apply(_getPrototypeOf2, [this].concat(args)));
304
305
    pdfFileLoader_defineProperty(_assertThisInitialized(_this), "fileType", 'application/pdf');
306
307
    return _this;
308
  }
309
310
  pdfFileLoader_createClass(_temp, [{
311
    key: "loadFile",
312
    value: function loadFile(file, imageId) {
313
      return cornerstoneWADOImageLoader_min_default.a.wadouri.loadFileRequest(imageId);
314
    }
315
  }, {
316
    key: "getDataset",
317
    value: function getDataset(image, imageId) {
318
      var dataset = {};
319
      dataset.imageId = image.imageId || imageId;
320
      return dataset;
321
    }
322
  }, {
323
    key: "getStudies",
324
    value: function getStudies(dataset, imageId) {
325
      return this.getDefaultStudy(imageId);
326
    }
327
  }, {
328
    key: "getDefaultStudy",
329
    value: function getDefaultStudy(imageId) {
330
      var study = {
331
        StudyInstanceUID: '',
332
        StudyDate: '',
333
        StudyTime: '',
334
        AccessionNumber: '',
335
        ReferringPhysicianName: '',
336
        PatientName: '',
337
        PatientID: '',
338
        PatientBirthdate: '',
339
        PatientSex: '',
340
        StudyId: '',
341
        StudyDescription: '',
342
        series: [{
343
          SeriesInstanceUID: '',
344
          SeriesDescription: '',
345
          SeriesNumber: '',
346
          instances: [{
347
            metadata: {
348
              SOPInstanceUID: '',
349
              SOPClassUID: '1.2.840.10008.5.1.4.1.1.104.1',
350
              Rows: '',
351
              Columns: '',
352
              NumberOfFrames: 0,
353
              InstanceNumber: 1
354
            },
355
            getImageId: function getImageId() {
356
              return imageId;
357
            },
358
            isLocalFile: true
359
          }]
360
        }]
361
      };
362
      return study;
363
    }
364
  }]);
365
366
  return _temp;
367
}(FileLoader), pdfFileLoader_temp)();
368
/* harmony default export */ var pdfFileLoader = (PDFFileLoader);
369
// EXTERNAL MODULE: /home/salim/GaelO-Dev/OHIF/Viewers/node_modules/dcmjs/build/dcmjs.es.js
370
var dcmjs_es = __webpack_require__(30);
371
372
// EXTERNAL MODULE: /home/salim/GaelO-Dev/OHIF/Viewers/platform/core/src/index.js + 33 modules
373
var src = __webpack_require__(13);
374
375
// CONCATENATED MODULE: ./lib/localFileLoaders/dicomFileLoader.js
376
var dicomFileLoader_temp;
377
378
function dicomFileLoader_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { dicomFileLoader_typeof = function _typeof(obj) { return typeof obj; }; } else { dicomFileLoader_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return dicomFileLoader_typeof(obj); }
0 ignored issues
show
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. dicomFileLoader_typeof is already defined in line 378 as a function. While this will work, it can be very confusing.
Loading history...
Bug introduced by
The variable Symbol seems to be never declared. If this is a global, consider adding a /** global: Symbol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
379
380
function dicomFileLoader_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
381
382
function dicomFileLoader_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
383
384
function dicomFileLoader_createClass(Constructor, protoProps, staticProps) { if (protoProps) dicomFileLoader_defineProperties(Constructor.prototype, protoProps); if (staticProps) dicomFileLoader_defineProperties(Constructor, staticProps); return Constructor; }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
385
386
function dicomFileLoader_possibleConstructorReturn(self, call) { if (call && (dicomFileLoader_typeof(call) === "object" || typeof call === "function")) { return call; } return dicomFileLoader_assertThisInitialized(self); }
387
388
function dicomFileLoader_getPrototypeOf(o) { dicomFileLoader_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return dicomFileLoader_getPrototypeOf(o); }
0 ignored issues
show
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. dicomFileLoader_getPrototypeOf is already defined in line 388 as a function. While this will work, it can be very confusing.
Loading history...
389
390
function dicomFileLoader_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
391
392
function dicomFileLoader_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) dicomFileLoader_setPrototypeOf(subClass, superClass); }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
393
394
function dicomFileLoader_setPrototypeOf(o, p) { dicomFileLoader_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return dicomFileLoader_setPrototypeOf(o, p); }
0 ignored issues
show
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. dicomFileLoader_setPrototypeOf is already defined in line 394 as a function. While this will work, it can be very confusing.
Loading history...
395
396
function dicomFileLoader_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
397
398
399
400
401
402
var metadataProvider = src["a" /* default */].cornerstone.metadataProvider;
403
var DICOMFileLoader = new (dicomFileLoader_temp =
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
404
/*#__PURE__*/
405
function (_FileLoader) {
406
  dicomFileLoader_inherits(_temp, _FileLoader);
407
408
  function _temp() {
409
    var _getPrototypeOf2;
410
411
    var _this;
412
413
    dicomFileLoader_classCallCheck(this, _temp);
414
415
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
0 ignored issues
show
Coding Style Best Practice introduced by
Using the Array constructor is generally discouraged. Consider using an array literal instead.
Loading history...
416
      args[_key] = arguments[_key];
417
    }
418
419
    _this = dicomFileLoader_possibleConstructorReturn(this, (_getPrototypeOf2 = dicomFileLoader_getPrototypeOf(_temp)).call.apply(_getPrototypeOf2, [this].concat(args)));
420
421
    dicomFileLoader_defineProperty(dicomFileLoader_assertThisInitialized(_this), "fileType", 'application/dicom');
422
423
    return _this;
424
  }
425
426
  dicomFileLoader_createClass(_temp, [{
427
    key: "loadFile",
428
    value: function loadFile(file, imageId) {
429
      return cornerstoneWADOImageLoader_min_default.a.wadouri.loadFileRequest(imageId);
430
    }
431
  }, {
432
    key: "getDataset",
433
    value: function getDataset(image, imageId) {
434
      var dataset = {};
435
436
      try {
437
        var dicomData = dcmjs_es["a" /* default */].data.DicomMessage.readFile(image);
438
        dataset = dcmjs_es["a" /* default */].data.DicomMetaDictionary.naturalizeDataset(dicomData.dict);
439
        metadataProvider.addInstance(dataset);
440
        dataset._meta = dcmjs_es["a" /* default */].data.DicomMetaDictionary.namifyDataset(dicomData.meta);
441
      } catch (e) {
442
        console.error('Error reading dicom file', e);
443
      } // Set imageId on dataset to be consumed later on
444
445
446
      dataset.imageId = imageId;
447
      return dataset;
448
    }
449
  }, {
450
    key: "getStudies",
451
    value: function getStudies(dataset, imageId) {
0 ignored issues
show
Unused Code introduced by
The parameter imageId is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
452
      return this.getStudyFromDataset(dataset);
453
    }
454
  }, {
455
    key: "getStudyFromDataset",
456
    value: function getStudyFromDataset() {
457
      var dataset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
458
      var StudyInstanceUID = dataset.StudyInstanceUID,
459
          StudyDate = dataset.StudyDate,
460
          StudyTime = dataset.StudyTime,
461
          AccessionNumber = dataset.AccessionNumber,
462
          ReferringPhysicianName = dataset.ReferringPhysicianName,
463
          PatientName = dataset.PatientName,
464
          PatientID = dataset.PatientID,
465
          PatientBirthDate = dataset.PatientBirthDate,
466
          PatientSex = dataset.PatientSex,
467
          StudyID = dataset.StudyID,
468
          StudyDescription = dataset.StudyDescription,
469
          SeriesInstanceUID = dataset.SeriesInstanceUID,
470
          SeriesDescription = dataset.SeriesDescription,
471
          SeriesNumber = dataset.SeriesNumber,
472
          imageId = dataset.imageId;
473
      var instance = {
474
        metadata: dataset,
475
        url: imageId
476
      };
477
      var series = {
478
        SeriesInstanceUID: SeriesInstanceUID,
479
        SeriesDescription: SeriesDescription,
480
        SeriesNumber: SeriesNumber,
481
        instances: [instance]
482
      };
483
      var study = {
484
        StudyInstanceUID: StudyInstanceUID,
485
        StudyDate: StudyDate,
486
        StudyTime: StudyTime,
487
        AccessionNumber: AccessionNumber,
488
        ReferringPhysicianName: ReferringPhysicianName,
489
        PatientName: PatientName,
490
        PatientID: PatientID,
491
        PatientBirthDate: PatientBirthDate,
492
        PatientSex: PatientSex,
493
        StudyID: StudyID,
494
        StudyDescription: StudyDescription,
495
496
        /*
497
        TODO: in case necessary to uncomment this block, double check every property
498
        numberOfStudyRelatedSeries: NumberOfStudyRelatedSeries || DICOMWeb.getString(dataset['00201206']),
499
        numberOfStudyRelatedInstances: NumberOfStudyRelatedInstances || DICOMWeb.getString(dataset['00201208']),
500
        Modality: Modality || DICOMWeb.getString(dataset['00080060']),
501
        ModalitiesInStudy: ModalitiesInStudy || DICOMWeb.getString(dataset['00080061']),
502
        modalities:
503
        */
504
        series: [series]
505
      };
506
      return study;
507
    }
508
  }]);
509
510
  return _temp;
511
}(FileLoader), dicomFileLoader_temp)();
512
/* harmony default export */ var dicomFileLoader = (DICOMFileLoader);
513
// CONCATENATED MODULE: ./lib/localFileLoaders/fileLoaderService.js
514
function fileLoaderService_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { fileLoaderService_typeof = function _typeof(obj) { return typeof obj; }; } else { fileLoaderService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return fileLoaderService_typeof(obj); }
0 ignored issues
show
Bug introduced by
The variable Symbol seems to be never declared. If this is a global, consider adding a /** global: Symbol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. fileLoaderService_typeof is already defined in line 514 as a function. While this will work, it can be very confusing.
Loading history...
515
516
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
517
518
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
519
520
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
Bug introduced by
The variable Symbol seems to be never declared. If this is a global, consider adding a /** global: Symbol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Complexity Best Practice introduced by
There is no return statement if Symbol.iterator in Objec...== "[object Arguments]" is false. Are you sure this is correct? If so, consider adding return; explicitly.

This check looks for functions where a return statement is found in some execution paths, but not in all.

Consider this little piece of code

function isBig(a) {
    if (a > 5000) {
        return "yes";
    }
}

console.log(isBig(5001)); //returns yes
console.log(isBig(42)); //returns undefined

The function isBig will only return a specific value when its parameter is bigger than 5000. In any other case, it will implicitly return undefined.

This behaviour may not be what you had intended. In any case, you can add a return undefined to the other execution path to make the return value explicit.

Loading history...
521
522
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
0 ignored issues
show
Complexity Best Practice introduced by
There is no return statement if Array.isArray(arr) is false. Are you sure this is correct? If so, consider adding return; explicitly.

This check looks for functions where a return statement is found in some execution paths, but not in all.

Consider this little piece of code

function isBig(a) {
    if (a > 5000) {
        return "yes";
    }
}

console.log(isBig(5001)); //returns yes
console.log(isBig(42)); //returns undefined

The function isBig will only return a specific value when its parameter is bigger than 5000. In any other case, it will implicitly return undefined.

This behaviour may not be what you had intended. In any case, you can add a return undefined to the other execution path to make the return value explicit.

Loading history...
523
524
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
525
526
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { fileLoaderService_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
0 ignored issues
show
Best Practice introduced by
Comparing arguments.i to null using the != operator is not safe. Consider using !== instead.
Loading history...
Bug introduced by
The variable source is changed as part of the for loop for example by arguments.i != null ? arguments.i: {} on line 526. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
527
528
function fileLoaderService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
529
530
function fileLoaderService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
531
532
function fileLoaderService_createClass(Constructor, protoProps, staticProps) { if (protoProps) fileLoaderService_defineProperties(Constructor.prototype, protoProps); if (staticProps) fileLoaderService_defineProperties(Constructor, staticProps); return Constructor; }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
533
534
function fileLoaderService_possibleConstructorReturn(self, call) { if (call && (fileLoaderService_typeof(call) === "object" || typeof call === "function")) { return call; } return fileLoaderService_assertThisInitialized(self); }
535
536
function fileLoaderService_getPrototypeOf(o) { fileLoaderService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return fileLoaderService_getPrototypeOf(o); }
0 ignored issues
show
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. fileLoaderService_getPrototypeOf is already defined in line 536 as a function. While this will work, it can be very confusing.
Loading history...
537
538
function fileLoaderService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
539
540
function fileLoaderService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) fileLoaderService_setPrototypeOf(subClass, superClass); }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
541
542
function fileLoaderService_setPrototypeOf(o, p) { fileLoaderService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return fileLoaderService_setPrototypeOf(o, p); }
0 ignored issues
show
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. fileLoaderService_setPrototypeOf is already defined in line 542 as a function. While this will work, it can be very confusing.
Loading history...
543
544
function fileLoaderService_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
545
546
547
548
549
550
551
var fileLoaderService_FileLoaderService =
552
/*#__PURE__*/
553
function (_FileLoader) {
554
  fileLoaderService_inherits(FileLoaderService, _FileLoader);
555
556
  function FileLoaderService(file) {
557
    var _this;
558
559
    fileLoaderService_classCallCheck(this, FileLoaderService);
560
561
    _this = fileLoaderService_possibleConstructorReturn(this, fileLoaderService_getPrototypeOf(FileLoaderService).call(this));
562
563
    fileLoaderService_defineProperty(fileLoaderService_assertThisInitialized(_this), "fileType", void 0);
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
564
565
    fileLoaderService_defineProperty(fileLoaderService_assertThisInitialized(_this), "loader", void 0);
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
566
567
    var fileType = file && file.type;
568
    _this.loader = _this.getLoader(fileType);
569
    _this.fileType = _this.loader.fileType;
570
    return _this;
571
  }
572
573
  fileLoaderService_createClass(FileLoaderService, [{
574
    key: "addFile",
575
    value: function addFile(file) {
576
      return cornerstoneWADOImageLoader_min_default.a.wadouri.fileManager.add(file);
577
    }
578
  }, {
579
    key: "loadFile",
580
    value: function loadFile(file, imageId) {
581
      return this.loader.loadFile(file, imageId);
582
    }
583
  }, {
584
    key: "getDataset",
585
    value: function getDataset(image, imageId) {
586
      return this.loader.getDataset(image, imageId);
587
    }
588
  }, {
589
    key: "getStudies",
590
    value: function getStudies(dataset, imageId) {
591
      return this.loader.getStudies(dataset, imageId);
592
    }
593
  }, {
594
    key: "getLoader",
595
    value: function getLoader(fileType) {
596
      if (fileType === 'application/pdf') {
597
        return pdfFileLoader;
598
      } else {
0 ignored issues
show
Comprehensibility introduced by
else is not necessary here since all if branches return, consider removing it to reduce nesting and make code more readable.
Loading history...
599
        // Default to dicom loader
600
        return dicomFileLoader;
601
      }
602
    }
603
  }], [{
604
    key: "groupSeries",
605
    value: function groupSeries(studies) {
606
      var groupBy = function groupBy(list, groupByKey, listKey) {
607
        var nonKeyCounter = 1;
608
        return list.reduce(function (acc, obj) {
609
          var _acc$key$listKey;
610
611
          var key = obj[groupByKey];
612
          var list = obj[listKey]; // in case key not found, group it using counter
613
614
          key = !!key ? key : '' + nonKeyCounter++;
615
616
          if (!acc[key]) {
617
            acc[key] = _objectSpread({}, obj);
618
            acc[key][listKey] = [];
619
          }
620
621
          (_acc$key$listKey = acc[key][listKey]).push.apply(_acc$key$listKey, _toConsumableArray(list));
622
623
          return acc;
624
        }, {});
625
      };
626
627
      var studiesGrouped = Object.values(groupBy(studies, 'StudyInstanceUID', 'series'));
628
      var result = studiesGrouped.map(function (studyGroup) {
629
        var seriesGrouped = groupBy(studyGroup.series, 'SeriesInstanceUID', 'instances');
630
        studyGroup.series = Object.values(seriesGrouped);
631
        return studyGroup;
632
      });
633
      return result;
634
    }
635
  }]);
636
637
  return FileLoaderService;
638
}(FileLoader);
639
640
/* harmony default export */ var localFileLoaders_fileLoaderService = (fileLoaderService_FileLoaderService);
641
// CONCATENATED MODULE: ./lib/filesToStudies.js
642
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return filesToStudies; });
643
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
644
645
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
646
647
648
649
var processFile =
650
/*#__PURE__*/
651
function () {
652
  var _ref = _asyncToGenerator(
653
  /*#__PURE__*/
654
  regeneratorRuntime.mark(function _callee(file) {
0 ignored issues
show
Bug introduced by
The variable regeneratorRuntime seems to be never declared. If this is a global, consider adding a /** global: regeneratorRuntime */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
655
    var fileLoaderService, imageId, image, dataset, studies;
656
    return regeneratorRuntime.wrap(function _callee$(_context) {
0 ignored issues
show
Bug introduced by
The variable regeneratorRuntime seems to be never declared. If this is a global, consider adding a /** global: regeneratorRuntime */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
657
      while (1) {
658
        switch (_context.prev = _context.next) {
659
          case 0:
660
            _context.prev = 0;
661
            fileLoaderService = new localFileLoaders_fileLoaderService(file);
0 ignored issues
show
Coding Style Best Practice introduced by
By convention, constructors like localFileLoaders_fileLoaderService should be capitalized.
Loading history...
662
            imageId = fileLoaderService.addFile(file);
0 ignored issues
show
Bug introduced by
The variable fileLoaderService is changed as part of the while loop for example by new localFileLoaders_fileLoaderService(file) on line 661. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
663
            _context.next = 5;
664
            return fileLoaderService.loadFile(file, imageId);
0 ignored issues
show
Bug introduced by
The variable imageId is changed as part of the while loop for example by fileLoaderService.addFile(file) on line 662. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
665
666
          case 5:
667
            image = _context.sent;
668
            _context.next = 8;
669
            return fileLoaderService.getDataset(image, imageId);
0 ignored issues
show
Bug introduced by
The variable image is changed as part of the while loop for example by _context.sent on line 667. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
670
671
          case 8:
672
            dataset = _context.sent;
673
            _context.next = 11;
674
            return fileLoaderService.getStudies(dataset, imageId);
0 ignored issues
show
Bug introduced by
The variable dataset is changed as part of the while loop for example by _context.sent on line 672. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
675
676
          case 11:
677
            studies = _context.sent;
678
            return _context.abrupt("return", studies);
0 ignored issues
show
Bug introduced by
The variable studies is changed as part of the while loop for example by _context.sent on line 677. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
679
680
          case 15:
681
            _context.prev = 15;
682
            _context.t0 = _context["catch"](0);
683
            console.log(_context.t0.name, ':Error when trying to load and process local files:', _context.t0.message);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
684
685
          case 18:
686
          case "end":
687
            return _context.stop();
688
        }
689
      }
0 ignored issues
show
Best Practice introduced by
There is no return statement in this branch, but you do return something in other branches. Did you maybe miss it? If you do not want to return anything, consider adding return undefined; explicitly.
Loading history...
690
    }, _callee, null, [[0, 15]]);
691
  }));
692
693
  return function processFile(_x) {
0 ignored issues
show
Unused Code introduced by
The parameter _x is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
694
    return _ref.apply(this, arguments);
695
  };
696
}();
697
698
function filesToStudies(_x2) {
0 ignored issues
show
Unused Code introduced by
The parameter _x2 is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
699
  return _filesToStudies.apply(this, arguments);
700
}
701
702
function _filesToStudies() {
703
  _filesToStudies = _asyncToGenerator(
0 ignored issues
show
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. _filesToStudies is already defined in line 702 as a function. While this will work, it can be very confusing.
Loading history...
704
  /*#__PURE__*/
705
  regeneratorRuntime.mark(function _callee2(files) {
0 ignored issues
show
Bug introduced by
The variable regeneratorRuntime seems to be never declared. If this is a global, consider adding a /** global: regeneratorRuntime */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
706
    var processFilesPromises, studies;
707
    return regeneratorRuntime.wrap(function _callee2$(_context2) {
0 ignored issues
show
Bug introduced by
The variable regeneratorRuntime seems to be never declared. If this is a global, consider adding a /** global: regeneratorRuntime */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
708
      while (1) {
709
        switch (_context2.prev = _context2.next) {
710
          case 0:
711
            processFilesPromises = files.map(processFile);
712
            _context2.next = 3;
713
            return Promise.all(processFilesPromises);
0 ignored issues
show
Bug introduced by
The variable processFilesPromises is changed as part of the while loop for example by files.map(processFile) on line 711. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
714
715
          case 3:
716
            studies = _context2.sent;
717
            return _context2.abrupt("return", localFileLoaders_fileLoaderService.groupSeries(studies.flat()));
0 ignored issues
show
Bug introduced by
The variable studies is changed as part of the while loop for example by _context2.sent on line 716. Only the value of the last iteration will be visible in this function if it is called after the loop.
Loading history...
718
719
          case 5:
720
          case "end":
721
            return _context2.stop();
722
        }
723
      }
0 ignored issues
show
Best Practice introduced by
There is no return statement in this branch, but you do return something in other branches. Did you maybe miss it? If you do not want to return anything, consider adding return undefined; explicitly.
Loading history...
724
    }, _callee2);
725
  }));
726
  return _filesToStudies.apply(this, arguments);
727
}
728
729
/***/ }),
730
731
/***/ 990:
732
/***/ (function(module, exports, __webpack_require__) {
0 ignored issues
show
Unused Code introduced by
The parameter module is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter __webpack_require__ is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter exports is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
733
734
// extracted by extract-css-chunks-webpack-plugin
735
736
/***/ })
737
738
}]);