rbutrcom/rbutr-browser-extension

View on GitHub

Showing 53 of 77 total issues

Function RbutrUtils has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RbutrUtils = () => {

    'use strict';

    const devStorageKey = 'rbutr.isDev';
Severity: Major
Found in src/utils.js - About 2 hrs to fix

    Function refreshSubmissionData has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        const refreshSubmissionData = () => {
    
            const HTTP_LENGTH = 4;
    
            if (rbutr.getPropLen('sourceUrls') > ONE) {
    Severity: Major
    Found in src/popup.js - About 2 hrs to fix

      Function createMessageTemplate has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          const createMessageTemplate = ($data, requestedUrl) => {
      
              let
                  messageTemplate = '',
                  rbutrLogo = '<img src="' + content.serverDomain + '/images/logohomepagelowres.png" width="24" class="rbutr-logo" alt="Rbutr">',
      Severity: Major
      Found in src/contentScript.js - About 2 hrs to fix

        File md5.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
         * Digest Algorithm, as defined in RFC 1321.
         * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
         * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
        Severity: Minor
        Found in src/vendors/md5.js - About 2 hrs to fix

          Function onreadystatechange has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          document.onreadystatechange = () => {
          
              'use strict';
          
              if (document.readyState === 'complete') {
          Severity: Major
          Found in src/contentScript.js - About 2 hrs to fix

            Function Platform has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Platform = () => {
            
                'use strict';
            
                let properties = {
            Severity: Major
            Found in src/contentScript.js - About 2 hrs to fix

              Function Platform has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              const Platform = () => {
              
                  'use strict';
              
                  let properties = {
              Severity: Minor
              Found in src/contentScript.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 getRebuttals has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  const getRebuttals = (tabId, url) => {
              
                      setProp('rebuttals', tabId, null);
                      let canVote = false;
                      let recordedClick = getRecordedClickByToUrl(getProp('canonicalUrls', tabId));
              Severity: Minor
              Found in src/background.js - About 1 hr to fix

                Function EventTarget has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var EventTarget = function() {
                        var eventSplitter = /\s+/;
                        return {
                            on: function(events, callback) {
                                var event;
                Severity: Minor
                Found in src/vendors/typeahead.js - About 1 hr to fix

                  Function submitRebuttals has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      const submitRebuttals = (tabId) => {
                  
                          let sourcePageTitles = [];
                          let rebuttalPageTitles = [];
                          let canonicalSourcePages = [];
                  Severity: Minor
                  Found in src/background.js - About 1 hr to fix

                    Function initialize has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                initialize: function(datasetDefs) {
                                    var datasets;
                                    datasetDefs = utils.isArray(datasetDefs) ? datasetDefs : [ datasetDefs ];
                                    if (datasetDefs.length === 0) {
                                        $.error("no datasets provided");
                    Severity: Minor
                    Found in src/vendors/typeahead.js - About 1 hr to fix

                      Function _loadPrefetchData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  _loadPrefetchData: function(o) {
                                      var that = this, thumbprint = VERSION + (o.thumbprint || ""), storedThumbprint, storedProtocol, storedItemHash, storedAdjacencyList, isExpired, deferred;
                                      if (this.storage) {
                                          storedThumbprint = this.storage.get(keys.thumbprint);
                                          storedProtocol = this.storage.get(keys.protocol);
                      Severity: Minor
                      Found in src/vendors/typeahead.js - About 1 hr to fix

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

                        function rstr2b64(input)
                        {
                          try { b64pad } catch(e) { b64pad=''; }
                          var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
                          var output = "";
                        Severity: Minor
                        Found in src/vendors/md5.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 View has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const View = () => {
                        
                            'use strict';
                        
                        
                        
                        Severity: Minor
                        Found in src/popup.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 str2rstr_utf8 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function str2rstr_utf8(input)
                        {
                          var output = "";
                          var i = -1;
                          var x, y;
                        Severity: Minor
                        Found in src/vendors/md5.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 _getLocalSuggestions has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    _getLocalSuggestions: function(terms) {
                                        var that = this, firstChars = [], lists = [], shortestList, suggestions = [];
                                        utils.each(terms, function(i, term) {
                                            var firstChar = term.charAt(0);
                                            !~utils.indexOf(firstChars, firstChar) && firstChars.push(firstChar);
                        Severity: Minor
                        Found in src/vendors/typeahead.js - About 1 hr to fix

                          Function setAlertOnPosts has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              const setAlertOnPosts = () => {
                          
                                  let
                                      index = 0,
                                      itemSelectors = platform.getProp('config').itemSelectors,
                          Severity: Minor
                          Found in src/contentScript.js - About 1 hr to fix

                            Function rstr2any has 29 lines of code (exceeds 25 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 1 hr to fix

                              Function View has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const View = () => {
                              
                                  'use strict';
                              
                              
                              
                              Severity: Minor
                              Found in src/popup.js - About 1 hr to fix

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

                                function str2rstr_utf8(input)
                                {
                                  var output = "";
                                  var i = -1;
                                  var x, y;
                                Severity: Minor
                                Found in src/vendors/md5.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language