Katochimoto/x-bubbles

View on GitHub

Showing 28 of 48 total issues

Function bubbling has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function bubbling(nodeSet) {
    const begining = nodeSet.options('begining');
    const ending = nodeSet.options('ending');
    const separator = nodeSet.options('separator');
    const tokenizer = nodeSet.options('tokenizer');
Severity: Major
Found in src/core/bubble.js - About 2 hrs to fix

    Function range has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    function range(node) {
        if (!bubble.isBubbleNode(node)) {
            return;
        }
    
    
    Severity: Minor
    Found in src/core/select.js - About 2 hrs to fix

    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 onMousemove has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function onMousemove(dragSet) {
        const drag = dragSet.__drag__;
        if (!drag) {
            return;
        }
    Severity: Minor
    Found in src/core/drag/mouse.js - About 1 hr to fix

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

      function range(node) {
          if (!bubble.isBubbleNode(node)) {
              return;
          }
      
      
      Severity: Minor
      Found in src/core/select.js - About 1 hr to fix

        Function exports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = function (event, sharedData) {
            const nodeEditor = sharedData.nodeEditor;
            const nodeBubble = sharedData.nodeBubble;
            const isDblclick = sharedData.isDblclick;
        
        
        Severity: Minor
        Found in src/core/editor/click.js - About 1 hr to fix

        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 onMouseup has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function onMouseup(dragSet, event) {
            const drag = dragSet.__drag__;
            if (!drag) {
                return;
            }
        Severity: Minor
        Found in src/core/drag/mouse.js - About 1 hr to fix

          Function onMouseup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function onMouseup(dragSet, event) {
              const drag = dragSet.__drag__;
              if (!drag) {
                  return;
              }
          Severity: Minor
          Found in src/core/drag/mouse.js - About 1 hr to fix

          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 exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function (event) {
              const code = events.keyCode(event);
              const nodeEditor = event.currentTarget;
          
              if (code === KEY.Enter) {
          Severity: Minor
          Found in src/core/editor/keypress.js - About 1 hr to fix

          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 onMousemove has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function onMousemove(dragSet) {
              const drag = dragSet.__drag__;
              if (!drag) {
                  return;
              }
          Severity: Minor
          Found in src/core/drag/mouse.js - About 1 hr to fix

          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 getBubbleRanges has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function getBubbleRanges(nodeSet) {
              const ranges = [];
              const children = nodeSet.childNodes;
              let range;
              let node;
          Severity: Minor
          Found in src/core/bubble.js - About 1 hr to fix

          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 ready has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.ready = (function () {
              let elements = [];
              let ready = false;
              let lock = false;
          
          
          Severity: Minor
          Found in src/core/utils.js - About 1 hr to fix

            Function edit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function edit(nodeSet, nodeBubble) {
                if (nodeBubble.hasAttribute('readonly')) {
                    return false;
                }
            
            
            Severity: Minor
            Found in src/core/bubble.js - About 1 hr to fix

              Function exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function (event, sharedData) {
                  const nodeEditor = sharedData.nodeEditor;
                  const nodeBubble = sharedData.nodeBubble;
                  const isDblclick = sharedData.isDblclick;
              
              
              Severity: Minor
              Found in src/core/select/click.js - About 1 hr to fix

              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 exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function (event, sharedData) {
                  const code = events.keyCode(event);
                  const metaKey = events.metaKey(event);
              
                  switch (code) {
              Severity: Minor
              Found in src/core/editor/keydown.js - About 1 hr to fix

                Function create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function create(nodeEditor, dataText, dataAttributes = {}) {
                    dataText = text.textClean(dataText);
                
                    if (!dataText) {
                        return;
                Severity: Minor
                Found in src/core/bubble.js - About 1 hr to fix

                  Function onMousedown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function onMousedown(event) {
                      const nodeBubble = bubbleset.closestNodeBubble(event.target);
                      if (!nodeBubble) {
                          return;
                      }
                  Severity: Minor
                  Found in src/core/drag/mouse.js - About 1 hr to fix

                    Function reg has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        reg: function (value) {
                            const type = typeof value;
                            switch (type) {
                            case 'string':
                                if (value) {
                    Severity: Minor
                    Found in src/core/options.js - About 55 mins to fix

                    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 findBubbleLeft has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function findBubbleLeft(selection) {
                        if (!selection.focusNode || !selection.anchorNode) {
                            return;
                        }
                    
                    
                    Severity: Minor
                    Found in src/core/bubbleset.js - About 55 mins to fix

                    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 findBubbleRight has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function findBubbleRight(selection) {
                        if (!selection.focusNode || !selection.anchorNode) {
                            return;
                        }
                    
                    
                    Severity: Minor
                    Found in src/core/bubbleset.js - About 55 mins to fix

                    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 toggleEvent has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function toggleEvent(element, eventName, userCallback, isSet = true, isLocal = false, isOne = false) {
                    Severity: Minor
                    Found in src/core/events.js - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language