OpenFn/OpenFn-Site

View on GitHub
app/assets/javascripts/jquery.hotkeys.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function keyHandler has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function keyHandler(handleObj) {
    if (typeof handleObj.data === "string") {
      handleObj.data = {
        keys: handleObj.data
      };
Severity: Minor
Found in app/assets/javascripts/jquery.hotkeys.js - About 2 hrs to fix

    Function handler has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        handleObj.handler = function(event) {
          //      Don't fire in text-accepting inputs that we didn't directly bind to
          if (this !== event.target &&
            (jQuery.hotkeys.options.filterInputAcceptingElements &&
              jQuery.hotkeys.textInputTypes.test(event.target.nodeName) ||
    Severity: Minor
    Found in app/assets/javascripts/jquery.hotkeys.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

            if (this !== event.target &&
              (jQuery.hotkeys.options.filterInputAcceptingElements &&
                jQuery.hotkeys.textInputTypes.test(event.target.nodeName) ||
                (jQuery.hotkeys.options.filterContentEditable && jQuery(event.target).attr('contenteditable')) ||
                (jQuery.hotkeys.options.filterTextInputs &&
      Severity: Major
      Found in app/assets/javascripts/jquery.hotkeys.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status