rbutrcom/rbutr-browser-extension

View on GitHub

Showing 53 of 77 total issues

File typeahead.js has 1130 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * typeahead.js 0.9.3
 * https://github.com/twitter/typeahead
 * Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT
 */
Severity: Major
Found in src/vendors/typeahead.js - About 2 days to fix

    Function Popup has 318 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Popup = () => {
    
        'use strict';
    
        const ZERO = 0;
    Severity: Major
    Found in src/popup.js - About 1 day to fix

      Function Rbutr has 281 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Rbutr = () => {
      
          'use strict';
      
          let properties = {
      Severity: Major
      Found in src/background.js - About 1 day to fix

        Function Rbutr has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
        Open

        const Rbutr = () => {
        
            'use strict';
        
            let properties = {
        Severity: Minor
        Found in src/background.js - About 1 day 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 TypeaheadView has 215 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var TypeaheadView = function() {
                var html = {
                    wrapper: '<span class="twitter-typeahead"></span>',
                    hint: '<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',
                    dropdown: '<span class="tt-dropdown-menu"></span>'
        Severity: Major
        Found in src/vendors/typeahead.js - About 1 day to fix

          Function Content has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
          Open

          const Content = () => {
          
              'use strict';
          
              let canonicalValue = $('head link[rel=canonical]').attr('href');
          Severity: Minor
          Found in src/contentScript.js - About 1 day 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 Popup has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

          const Popup = () => {
          
              'use strict';
          
              const ZERO = 0;
          Severity: Minor
          Found in src/popup.js - About 1 day 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 Dataset has 192 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var Dataset = function() {
                  var keys = {
                      thumbprint: "thumbprint",
                      protocol: "protocol",
                      itemHash: "itemHash",
          Severity: Major
          Found in src/vendors/typeahead.js - About 7 hrs to fix

            Function Content has 185 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Content = () => {
            
                'use strict';
            
                let canonicalValue = $('head link[rel=canonical]').attr('href');
            Severity: Major
            Found in src/contentScript.js - About 7 hrs to fix

              File popup.js has 448 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*!
               * Rbutr Browser Extension v0.12.0
               * https://github.com/rbutrcom/rbutr-browser-extension
               *
               * Copyright 2012-2017 The Rbutr Community
              Severity: Minor
              Found in src/popup.js - About 6 hrs to fix

                Function DropdownView has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var DropdownView = function() {
                        var html = {
                            suggestionsList: '<span class="tt-suggestions"></span>'
                        }, css = {
                            suggestionsList: {
                Severity: Major
                Found in src/vendors/typeahead.js - About 6 hrs to fix

                  Function InputView has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var InputView = function() {
                          function InputView(o) {
                              var that = this;
                              utils.bindAll(this);
                              this.specialKeyCodeMap = {
                  Severity: Major
                  Found in src/vendors/typeahead.js - About 4 hrs to fix

                    File background.js has 364 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*!
                     * Rbutr Browser Extension v0.12.0
                     * https://github.com/rbutrcom/rbutr-browser-extension
                     *
                     * Copyright 2012-2017 The Rbutr Community
                    Severity: Minor
                    Found in src/background.js - About 4 hrs to fix

                      File contentScript.js has 350 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*!
                       * Rbutr Browser Extension v0.12.0
                       * https://github.com/rbutrcom/rbutr-browser-extension
                       *
                       * Copyright 2012-2017 The Rbutr Community
                      Severity: Minor
                      Found in src/contentScript.js - About 4 hrs to fix

                        Function RbutrApi has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const RbutrApi = (utils) => {
                        
                            'use strict';
                        
                            const devDomain = 'https://russell.rbutr.com';
                        Severity: Major
                        Found in src/rbutrApi.js - About 4 hrs to fix

                          Function binl_md5 has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function binl_md5(x, len)
                          {
                            /* append padding */
                            x[len >> 5] |= 0x80 << ((len) % 32);
                            x[(((len + 64) >>> 9) << 4) + 14] = len;
                          Severity: Major
                          Found in src/vendors/md5.js - About 3 hrs to fix

                            Function PersistentStorage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                var PersistentStorage = function() {
                                    var ls, methods;
                                    try {
                                        ls = window.localStorage;
                                        ls.setItem("~~~", "!");
                            Severity: Major
                            Found in src/vendors/typeahead.js - About 3 hrs to fix

                              Function Transport has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  var Transport = function() {
                                      var pendingRequestsCount = 0, pendingRequests = {}, maxPendingRequests, requestCache;
                                      function Transport(o) {
                                          utils.bindAll(this);
                                          o = utils.isString(o) ? {
                              Severity: Major
                              Found in src/vendors/typeahead.js - About 3 hrs to fix

                                Function RbutrApi has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const RbutrApi = (utils) => {
                                
                                    'use strict';
                                
                                    const devDomain = 'https://russell.rbutr.com';
                                Severity: Minor
                                Found in src/rbutrApi.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 RbutrUtils has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const RbutrUtils = () => {
                                
                                    'use strict';
                                
                                    const devStorageKey = 'rbutr.isDev';
                                Severity: Minor
                                Found in src/utils.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

                                Severity
                                Category
                                Status
                                Source
                                Language