rbutrcom/rbutr-browser-extension

View on GitHub

Showing 53 of 77 total issues

Function createSingleMessageEntry has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    const createSingleMessageEntry = ($entry, type) => {
        return `
            <div class="rbutr-message-entry">
                <h6>${$entry[type].title}</h6>
                <a href="${$entry[type].url}">${$entry[type].url}</a>
Severity: Minor
Found in src/contentScript.js - About 1 hr to fix

    Function buildDomStructure has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function buildDomStructure(input) {
                var $wrapper = $(html.wrapper), $dropdown = $(html.dropdown), $input = $(input), $hint = $(html.hint);
                $wrapper = $wrapper.css(css.wrapper);
                $dropdown = $dropdown.css(css.dropdown);
                $hint.css(css.hint).css({
    Severity: Minor
    Found in src/vendors/typeahead.js - About 1 hr to fix

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

      function rstr2any(input, encoding)
      {
        var divisor = encoding.length;
        var i, j, q, x, quotient;
      
      
      Severity: Minor
      Found in src/vendors/md5.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 md5_gg has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function md5_gg(a, b, c, d, x, s, t)
      Severity: Major
      Found in src/vendors/md5.js - About 50 mins to fix

        Function md5_ff has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function md5_ff(a, b, c, d, x, s, t)
        Severity: Major
        Found in src/vendors/md5.js - About 50 mins to fix

          Function md5_ii has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function md5_ii(a, b, c, d, x, s, t)
          Severity: Major
          Found in src/vendors/md5.js - About 50 mins to fix

            Function md5_hh has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function md5_hh(a, b, c, d, x, s, t)
            Severity: Major
            Found in src/vendors/md5.js - About 50 mins to fix

              Function md5_cmn has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function md5_cmn(q, a, b, x, s, t)
              Severity: Minor
              Found in src/vendors/md5.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                        if (msg.status === 'success') {
                            popup.msg.add('info', msg.result);
                        } else if (msg.status === 'error') {
                            popup.msg.add('error', msg.result);
                        }
                Severity: Major
                Found in src/popup.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                      } else if (msg.response === 'submitRebuttalRequest') {
                          if (msg.status === 'success') {
                              popup.msg.add('info', msg.result);
                          } else if (msg.status === 'error') {
                              popup.msg.add('error', msg.result);
                  Severity: Major
                  Found in src/popup.js - About 45 mins to fix

                    Function Message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const Message = () => {
                    
                        'use strict';
                    
                        const $messageContainer = document.getElementById('messages');
                    Severity: Minor
                    Found in src/popup.js - About 35 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

                    Avoid too many return statements within this function.
                    Open

                                    return true;
                    Severity: Major
                    Found in src/background.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return true;
                      Severity: Major
                      Found in src/background.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language