src/_helpers/hotkeys.js

Summary

Maintainability
B
5 hrs
Test Coverage

File hotkeys.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * hotkeys-js v3.3.8
 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
 * 
 * Copyright (c) 2018 kenny wong <wowohoo@qq.com>
Severity: Minor
Found in src/_helpers/hotkeys.js - About 2 hrs to fix

    Function hotkeys has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function hotkeys(key, option, method, data) {
            var keys = getKeys(key); // List of shortcut keys to process
            var mods = [];
            var scope = 'all'; // Scope defaults to all, all ranges are valid
            var element = document; // Shortcut event binding node
    Severity: Minor
    Found in src/_helpers/hotkeys.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                  if (handler.mods.length === 0 && !_mods[16] && !_mods[18] && !_mods[17] && !_mods[91] || modifiersMatch || handler.shortcut === '*') {
                      // Call the handler, if it is a modifier key, it will not be processed.
                      if (handler.method(event, handler) === false) {
                          if (event.preventDefault) event.preventDefault(); else event.returnValue = false;
                          if (event.stopPropagation) event.stopPropagation();
      Severity: Major
      Found in src/_helpers/hotkeys.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status