Passed
Pull Request — dev (#52)
by Salim
17:21
created

src/ohif/CallbackPage.bundle.2d4145673c8f2481c46f.js   A

Complexity

Total Complexity 34
Complexity/F 1.7

Size

Lines of Code 89
Function Count 20

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 51
c 0
b 0
f 0
dl 0
loc 89
rs 9.68
wmc 34
mnd 14
bc 14
fnc 20
bpm 0.7
cpm 1.7
noi 8

12 Functions

Rating   Name   Duplication   Size   Complexity  
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _classCallCheck 0 1 2
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ render 0 22 4
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _assertThisInitialized 0 1 2
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ CallbackPage 0 5 2
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _getPrototypeOf 0 1 3
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _inherits 0 1 3
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _defineProperty 0 1 2
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _setPrototypeOf 0 1 2
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _defineProperties 0 1 3
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _createClass 0 1 3
A CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _possibleConstructorReturn 0 1 2
B CallbackPage.bundle.2d4145673c8f2481c46f.js ➔ _typeof 0 1 6
1
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
2
3
/***/ 1006:
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 react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(75);
11
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
12
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
13
/* harmony import */ var redux_oidc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82);
14
/* harmony import */ var redux_oidc__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(redux_oidc__WEBPACK_IMPORTED_MODULE_3__);
0 ignored issues
show
Unused Code introduced by
The variable redux_oidc__WEBPACK_IMPORTED_MODULE_3___default seems to be never used. Consider removing it.
Loading history...
15
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...
16
17
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
19
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...
20
21
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...
22
23
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
24
25
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...
26
27
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
29
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...
30
31
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
32
33
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; }
34
35
36
37
38
39
40
var CallbackPage =
41
/*#__PURE__*/
42
function (_Component) {
43
  _inherits(CallbackPage, _Component);
44
45
  function CallbackPage() {
46
    _classCallCheck(this, CallbackPage);
47
48
    return _possibleConstructorReturn(this, _getPrototypeOf(CallbackPage).apply(this, arguments));
49
  }
50
51
  _createClass(CallbackPage, [{
52
    key: "render",
53
    value: function render() {
54
      var _this = this;
55
56
      return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(redux_oidc__WEBPACK_IMPORTED_MODULE_3__["CallbackComponent"], {
57
        userManager: this.props.userManager,
58
        successCallback: function successCallback() {
59
          var _JSON$parse = JSON.parse(sessionStorage.getItem('ohif-redirect-to')),
0 ignored issues
show
Bug introduced by
The variable sessionStorage seems to be never declared. If this is a global, consider adding a /** global: sessionStorage */ 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...
60
              pathname = _JSON$parse.pathname,
61
              _JSON$parse$search = _JSON$parse.search,
62
              search = _JSON$parse$search === void 0 ? '' : _JSON$parse$search;
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...
63
64
          _this.props.history.push({
65
            pathname: pathname,
66
            search: search
67
          });
68
        },
69
        errorCallback: function errorCallback(error) {
70
          //this.props.history.push("/");
71
          throw new Error(error);
72
        }
73
      }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "Redirecting..."));
74
    }
75
  }]);
76
77
  return CallbackPage;
78
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
79
80
_defineProperty(CallbackPage, "propTypes", {
81
  userManager: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object.isRequired,
82
  history: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object.isRequired
83
});
84
85
/* harmony default export */ __webpack_exports__["default"] = (Object(react_router_dom__WEBPACK_IMPORTED_MODULE_1__[/* withRouter */ "g"])(CallbackPage));
86
87
/***/ })
88
89
}]);