Showing 321 of 538 total issues
Function draw
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function draw() {
var _this = this;
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
console.error('Must be in new state before drawing');
Function _initializeViewerComponents
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initializeViewerComponents: function _initializeViewerComponents() {
var _this2 = this;
var appConfig = this.appConfig;
return new Promise(function (resolve, reject) {
Function _initializeViewerComponents
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initializeViewerComponents: function _initializeViewerComponents() {
var _this2 = this;
var appConfig = this.appConfig;
return new Promise(function (resolve, reject) {
Function PDFCursorTools
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var PDFCursorTools = function () {
function PDFCursorTools(_ref) {
var _this = this;
var container = _ref.container,
Function PDFCursorTools
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var PDFCursorTools = function () {
function PDFCursorTools(_ref) {
var _this = this;
var container = _ref.container,
Function BasePreferences
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var BasePreferences = function () {
function BasePreferences() {
var _this = this;
_classCallCheck(this, BasePreferences);
Function scrollPageIntoView
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function scrollPageIntoView(params) {
if (!this.pdfDocument) {
return;
}
if (arguments.length > 1 || typeof params === 'number') {
Function BasePreferences
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var BasePreferences = function () {
function BasePreferences() {
var _this = this;
_classCallCheck(this, BasePreferences);
Function scrollPageIntoView
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function scrollPageIntoView(params) {
if (!this.pdfDocument) {
return;
}
if (arguments.length > 1 || typeof params === 'number') {
Function webViewerInitialized
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function webViewerInitialized() {
var appConfig = PDFViewerApplication.appConfig;
var file = void 0;
var queryString = document.location.search.substring(1);
var params = (0, _ui_utils.parseQueryString)(queryString);
Function PDFBugClosure
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.PDFBug = (function PDFBugClosure() {
var panelWidth = 300;
var buttons = [];
var activePanel = null;
Function webViewerInitialized
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function webViewerInitialized() {
var appConfig = PDFViewerApplication.appConfig;
var file = void 0;
var queryString = document.location.search.substring(1);
var params = (0, _ui_utils.parseQueryString)(queryString);
Function setDocument
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function setDocument(pdfDocument) {
var _this = this;
if (this.pdfDocument) {
this._cancelRendering();
Function setDocument
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function setDocument(pdfDocument) {
var _this = this;
if (this.pdfDocument) {
this._cancelRendering();
Function attachDOMEventsToEventBus
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function attachDOMEventsToEventBus(eventBus) {
eventBus.on('documentload', function () {
var event = document.createEvent('CustomEvent');
event.initCustomEvent('documentload', true, true, {});
window.dispatchEvent(event);
Function attachDOMEventsToEventBus
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function attachDOMEventsToEventBus(eventBus) {
eventBus.on('documentload', function () {
var event = document.createEvent('CustomEvent');
event.initCustomEvent('documentload', true, true, {});
window.dispatchEvent(event);
Function FontInspectorClosure
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
var FontInspector = (function FontInspectorClosure() {
var fonts;
var active = false;
var fontAttribute = 'data-font-name';
function removeSelection() {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function pdfHistoryInitialize
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialize: function pdfHistoryInitialize(fingerprint) {
this.initialized = true;
this.reInitialized = false;
this.allowHashChange = true;
this.historyUnlocked = true;
Function pdfHistoryInitialize
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialize: function pdfHistoryInitialize(fingerprint) {
this.initialized = true;
this.reInitialized = false;
this.allowHashChange = true;
this.historyUnlocked = true;
Function gen_dict_extract
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
def gen_dict_extract(key, var):
""" This method is used to recusrively find into a json structure (dict)
all values of a given key
credits: http://stackoverflow.com/questions/9807634/
find-all-occurences-of-a-key-in-nested-python-dictionaries-and-lists
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"