fossasia/loklak_webclient

View on GitHub
app/js/components/hello.all.js

Summary

Maintainability
F
1 mo
Test Coverage

File hello.all.js has 3731 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! hellojs v1.12.0 | (c) 2012-2016 Andrew Dodson | MIT https://adodson.com/hello.js/LICENSE */
// ES5 Object.create
if (!Object.create) {

    // Shim, Object create
Severity: Major
Found in app/js/components/hello.all.js - About 1 wk to fix

    Function post has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
    Open

        post: function(url, data, options, callback, callbackID, timeout) {
    
            var _this = this;
            var error = _this.error;
            var doc = document;
    Severity: Minor
    Found in app/js/components/hello.all.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 login has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

        login: function() {
    
            // Create an object which inherits its parent as the prototype and constructs a new event chain.
            var _this = this;
            var utils = _this.utils;
    Severity: Minor
    Found in app/js/components/hello.all.js - About 7 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 Promise has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        Promise: (function(){
            /*  promise states [Promises/A+ 2.1]  */
            var STATE_PENDING   = 0;                                         /*  [Promises/A+ 2.1.1]  */
            var STATE_FULFILLED = 1;                                         /*  [Promises/A+ 2.1.2]  */
            var STATE_REJECTED  = 2;                                         /*  [Promises/A+ 2.1.3]  */
    Severity: Minor
    Found in app/js/components/hello.all.js - About 6 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 responseHandler has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        responseHandler: function(window, parent) {
    
            var _this = this;
            var p;
            var location = window.location;
    Severity: Minor
    Found in app/js/components/hello.all.js - About 6 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 xhr has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        xhr: function(method, url, headers, data, callback) {
    
            var r = new XMLHttpRequest();
            var error = this.error;
    
    
    Severity: Minor
    Found in app/js/components/hello.all.js - About 6 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 append has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        append: function(node, attr, target) {
    
            var n = typeof (node) === 'string' ? document.createElement(node) : node;
    
            if (typeof (attr) === 'object') {
    Severity: Minor
    Found in app/js/components/hello.all.js - About 6 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 api has 145 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    hello.api = function() {
    
        // Shorthand
        var _this = this;
        var utils = _this.utils;
    Severity: Major
    Found in app/js/components/hello.all.js - About 5 hrs to fix

      Function login has 138 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          login: function() {
      
              // Create an object which inherits its parent as the prototype and constructs a new event chain.
              var _this = this;
              var utils = _this.utils;
      Severity: Major
      Found in app/js/components/hello.all.js - About 5 hrs to fix

        Function Event has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            Event: function() {
        
                var separator = /[\s\,]+/;
        
                // If this doesn't support getPrototype then we can't get prototype.events of the parent
        Severity: Minor
        Found in app/js/components/hello.all.js - About 5 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 post has 135 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            post: function(url, data, options, callback, callbackID, timeout) {
        
                var _this = this;
                var error = _this.error;
                var doc = document;
        Severity: Major
        Found in app/js/components/hello.all.js - About 5 hrs to fix

          Function args has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

              args: function(o, args) {
          
                  var p = {};
                  var i = 0;
                  var t = null;
          Severity: Minor
          Found in app/js/components/hello.all.js - About 4 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 request has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

              request: function(p, callback) {
          
                  var _this = this;
                  var error = _this.error;
          
          
          Severity: Minor
          Found in app/js/components/hello.all.js - About 4 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 Promise has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Promise: (function(){
                  /*  promise states [Promises/A+ 2.1]  */
                  var STATE_PENDING   = 0;                                         /*  [Promises/A+ 2.1.1]  */
                  var STATE_FULFILLED = 1;                                         /*  [Promises/A+ 2.1.2]  */
                  var STATE_REJECTED  = 2;                                         /*  [Promises/A+ 2.1.3]  */
          Severity: Major
          Found in app/js/components/hello.all.js - About 3 hrs to fix

            Function responseHandler has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                responseHandler: function(window, parent) {
            
                    var _this = this;
                    var p;
                    var location = window.location;
            Severity: Major
            Found in app/js/components/hello.all.js - About 3 hrs to fix

              Function api has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              hello.api = function() {
              
                  // Shorthand
                  var _this = this;
                  var utils = _this.utils;
              Severity: Minor
              Found in app/js/components/hello.all.js - About 3 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 xhr has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  xhr: function(method, url, headers, data, callback) {
              
                      var r = new XMLHttpRequest();
                      var error = this.error;
              
              
              Severity: Major
              Found in app/js/components/hello.all.js - About 3 hrs to fix

                Function request has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    request: function(p, callback) {
                
                        var _this = this;
                        var error = _this.error;
                
                
                Severity: Major
                Found in app/js/components/hello.all.js - About 3 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                              if ((typeof (o[x]) === 'function' && o[x].test(args[i])) || (typeof (o[x]) === 'string' && (
                              (o[x].indexOf('s') > -1 && t === 'string') ||
                              (o[x].indexOf('o') > -1 && t === 'object') ||
                              (o[x].indexOf('i') > -1 && t === 'number') ||
                              (o[x].indexOf('a') > -1 && t === 'object') ||
                  Severity: Critical
                  Found in app/js/components/hello.all.js - About 3 hrs to fix

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

                        param: function(s, formatFunction) {
                            var b;
                            var a = {};
                            var m;
                    
                    
                    Severity: Minor
                    Found in app/js/components/hello.all.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 logout has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        logout: function() {
                    
                            var _this = this;
                            var utils = _this.utils;
                            var error = utils.error;
                    Severity: Minor
                    Found in app/js/components/hello.all.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 store has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        store: (function() {
                    
                            var a = ['localStorage', 'sessionStorage'];
                            var i = -1;
                            var prefix = 'test';
                    Severity: Major
                    Found in app/js/components/hello.all.js - About 2 hrs to fix

                      Function getPath has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function getPath(url) {
                      
                              // Format the string if it needs it
                              url = url.replace(/\@\{([a-z\_\-]+)(\|.*?)?\}/gi, function(m, key, defaults) {
                                  var val = defaults ? defaults.replace(/^\|/, '') : '';
                      Severity: Major
                      Found in app/js/components/hello.all.js - About 2 hrs to fix

                        Function Event has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            Event: function() {
                        
                                var separator = /[\s\,]+/;
                        
                                // If this doesn't support getPrototype then we can't get prototype.events of the parent
                        Severity: Major
                        Found in app/js/components/hello.all.js - About 2 hrs to fix

                          Function self has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              (function self() {
                          
                                  var CURRENT_TIME = ((new Date()).getTime() / 1e3);
                                  var emit = function(eventName) {
                                      hello.emit('auth.' + eventName, {
                          Severity: Major
                          Found in app/js/components/hello.all.js - About 2 hrs to fix

                            Function uploadDrive has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function uploadDrive(p, callback) {
                            
                                    var data = {};
                            
                                    // Test for DOM element
                            Severity: Major
                            Found in app/js/components/hello.all.js - About 2 hrs to fix

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

                                  function formatEntry(a) {
                              
                                      var group = a.media$group;
                                      var photo = group.media$content.length ? group.media$content[0] : {};
                                      var mediaContent = group.media$content || [];
                              Severity: Major
                              Found in app/js/components/hello.all.js - About 2 hrs to fix

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

                                    function Multipart() {
                                
                                        // Internal body
                                        var body = [];
                                        var boundary = (Math.random() * 1e10).toString(32);
                                Severity: Major
                                Found in app/js/components/hello.all.js - About 2 hrs to fix

                                  Function jsonp has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      jsonp: function(url, callback, callbackID, timeout) {
                                  
                                          var _this = this;
                                          var error = _this.error;
                                  
                                  
                                  Severity: Minor
                                  Found in app/js/components/hello.all.js - About 1 hr to fix

                                    Function store has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        store: (function() {
                                    
                                            var a = ['localStorage', 'sessionStorage'];
                                            var i = -1;
                                            var prefix = 'test';
                                    Severity: Minor
                                    Found in app/js/components/hello.all.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 logout has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        logout: function() {
                                    
                                            var _this = this;
                                            var utils = _this.utils;
                                            var error = utils.error;
                                    Severity: Minor
                                    Found in app/js/components/hello.all.js - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                              else if (window.Element) {
                                                  return data instanceof window.Element && (!type || (data.tagName && data.tagName.toLowerCase() === type));
                                              }
                                              else {
                                                  return (!(data instanceof Object || data instanceof Array || data instanceof String || data instanceof Number) && data.tagName && data.tagName.toLowerCase() === type);
                                      Severity: Critical
                                      Found in app/js/components/hello.all.js - About 1 hr to fix

                                        Function append has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            append: function(node, attr, target) {
                                        
                                                var n = typeof (node) === 'string' ? document.createElement(node) : node;
                                        
                                                if (typeof (attr) === 'object') {
                                        Severity: Minor
                                        Found in app/js/components/hello.all.js - About 1 hr to fix

                                          Function dataToJSON has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                  dataToJSON: function(p) {
                                          
                                                      var _this = this;
                                                      var w = window;
                                                      var data = p.data;
                                          Severity: Minor
                                          Found in app/js/components/hello.all.js - About 1 hr to fix

                                            Function popup has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                hello.utils.popup = function(url, redirectUri, options) {
                                            
                                                    // Run the standard
                                                    var popup = utilPopup.call(this, url, redirectUri, options);
                                            
                                            
                                            Severity: Minor
                                            Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                  Array.prototype.forEach = function(fun/*, thisArg*/) {
                                              
                                                      if (this === void 0 || this === null) {
                                                          throw new TypeError();
                                                      }
                                              Severity: Minor
                                              Found in app/js/components/hello.all.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 formatFriends has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  function formatFriends(o, headers, req) {
                                                      paging(o);
                                                      var r = [];
                                                      if ('feed' in o && 'entry' in o.feed) {
                                                          var token = req.query.access_token;
                                              Severity: Minor
                                              Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                    extend: function(r /*, a[, b[, ...]] */) {
                                                
                                                        // Get the arguments as an array but ommit the initial item
                                                        Array.prototype.slice.call(arguments, 1).forEach(function(a) {
                                                            if (Array.isArray(r) && Array.isArray(a)) {
                                                Severity: Minor
                                                Found in app/js/components/hello.all.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 args has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    args: function(o, args) {
                                                
                                                        var p = {};
                                                        var i = 0;
                                                        var t = null;
                                                Severity: Minor
                                                Found in app/js/components/hello.all.js - About 1 hr to fix

                                                  Function me/share has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                                  'me/share': function(p, callback) {
                                                  
                                                                      var data = p.data;
                                                                      p.data = null;
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                        function format(o, headers, req) {
                                                            if (typeof o === 'boolean') {
                                                                o = {success: o};
                                                            }
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                          popup: function(url, redirectUri, options) {
                                                      
                                                              var documentElement = document.documentElement;
                                                      
                                                              // Multi Screen Popup Positioning (http://stackoverflow.com/a/16861050)
                                                      Severity: Minor
                                                      Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                                var resolve = function (promise, x) {
                                                                    /*  sanity check arguments  */                               /*  [Promises/A+ 2.3.1]  */
                                                                    if (promise === x || promise.proxy === x) {
                                                                        promise.reject(new TypeError("cannot resolve promise with itself"));
                                                                        return;
                                                        Severity: Minor
                                                        Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                              init: function(services, options) {
                                                          
                                                                  var utils = this.utils;
                                                          
                                                                  if (!services) {
                                                          Severity: Minor
                                                          Found in app/js/components/hello.all.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 formatFile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              function formatFile(o, headers, req) {
                                                          
                                                                  if (typeof o !== 'object' ||
                                                                      (typeof Blob !== 'undefined' && o instanceof Blob) ||
                                                                      (typeof ArrayBuffer !== 'undefined' && o instanceof ArrayBuffer)) {
                                                          Severity: Minor
                                                          Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                                    function _open(url, interactive) {
                                                            
                                                                        // Launch
                                                                        var ref = {
                                                                            closed: false
                                                            Severity: Minor
                                                            Found in app/js/components/hello.all.js - About 1 hr to fix

                                                              Consider simplifying this complex logical expression.
                                                              Open

                                                                      if (obj === null || typeof (obj) !== 'object' || obj instanceof Date || 'nodeName' in obj || this.isBinary(obj) || (typeof FormData === 'function' && obj instanceof FormData)) {
                                                                          return obj;
                                                                      }
                                                              Severity: Major
                                                              Found in app/js/components/hello.all.js - About 1 hr to fix

                                                                Consider simplifying this complex logical expression.
                                                                Open

                                                                            if (session && 'access_token' in session && session.access_token && 'expires' in session && session.expires > ((new Date()).getTime() / 1e3)) {
                                                                                // What is different about the scopes in the session vs the scopes in the new login?
                                                                                var diff = utils.diff((session.scope || '').split(SCOPE_SPLIT), (p.qs.state.scope || '').split(SCOPE_SPLIT));
                                                                                if (diff.length === 0) {
                                                                
                                                                
                                                                Severity: Major
                                                                Found in app/js/components/hello.all.js - About 1 hr to fix

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

                                                                      qs: function(url, params, formatFunction) {
                                                                  
                                                                          if (params) {
                                                                  
                                                                              // Set default formatting function
                                                                  Severity: Minor
                                                                  Found in app/js/components/hello.all.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 popup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                  Open

                                                                      popup: function(url, redirectUri, options) {
                                                                  
                                                                          var documentElement = document.documentElement;
                                                                  
                                                                          // Multi Screen Popup Positioning (http://stackoverflow.com/a/16861050)
                                                                  Severity: Minor
                                                                  Found in app/js/components/hello.all.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 post has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                      post: function(url, data, options, callback, callbackID, timeout) {
                                                                  Severity: Minor
                                                                  Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                    Function isEmpty has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        isEmpty: function(obj) {
                                                                    
                                                                            // Scalar
                                                                            if (!obj)
                                                                                return true;
                                                                    Severity: Minor
                                                                    Found in app/js/components/hello.all.js - About 45 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 domInstance has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        domInstance: function(type, data) {
                                                                            var test = 'HTML' + (type || '').replace(
                                                                                /^[a-z]/,
                                                                                function(m) {
                                                                                    return m.toUpperCase();
                                                                    Severity: Minor
                                                                    Found in app/js/components/hello.all.js - About 45 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 deeply nested control flow statements.
                                                                    Open

                                                                                    else if (el && data[x].name !== x) {
                                                                                        data[x].setAttribute('name', x);
                                                                                        data[x].name = x;
                                                                                    }
                                                                    Severity: Major
                                                                    Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                              if (this.events[name][i]) {
                                                                                                  // Emit on the local instance of this
                                                                                                  callback.call(this, name, i);
                                                                                              }
                                                                      Severity: Major
                                                                      Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                if (data[x].length === 1) {
                                                                                                    data[x] = data[x][0];
                                                                                                }
                                                                        Severity: Major
                                                                        Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                              if (typeof (attr[x]) === 'object') {
                                                                                                  for (var y in attr[x]) {if (attr[x].hasOwnProperty(y)) {
                                                                                                      n[x][y] = attr[x][y];
                                                                                                  }}
                                                                                              }
                                                                          Severity: Major
                                                                          Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                if (el) {
                                                                                                    input.value = data[x].value;
                                                                                                }
                                                                                                else if (_this.domInstance(null, data[x])) {
                                                                                                    input.value = data[x].innerHTML || data[x].innerText;
                                                                            Severity: Major
                                                                            Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                  if (input) {
                                                                                                      // Remove it.
                                                                                                      if (!(inputs instanceof NodeList)) {
                                                                                                          inputs = [inputs];
                                                                                                      }
                                                                              Severity: Major
                                                                              Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                    else if (_this.domInstance('input', data[x]) && data[x].type === 'file') {
                                                                                                        continue;
                                                                                                    }
                                                                                                    else if (_this.domInstance('input', data[x]) ||
                                                                                                        _this.domInstance('select', data[x]) ||
                                                                                Severity: Major
                                                                                Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                  else if (data[x] instanceof Blob) {
                                                                                                      f.append(x, data[x], data.name);
                                                                                                  }
                                                                                                  else {
                                                                                                      f.append(x, data[x]);
                                                                                  Severity: Major
                                                                                  Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                        if ('files' in data[x] && data[x].files.length > 0) {
                                                                                                            f.append(x, data[x].files[0]);
                                                                                                        }
                                                                                    Severity: Major
                                                                                    Found in app/js/components/hello.all.js - About 45 mins to fix

                                                                                      Consider simplifying this complex logical expression.
                                                                                      Open

                                                                                                  if (('File' in w && data instanceof w.File) ||
                                                                                                      ('Blob' in w && data instanceof w.Blob) ||
                                                                                                      ('FileList' in w && data instanceof w.FileList)) {
                                                                                                      data = {file: data};
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/js/components/hello.all.js - About 40 mins to fix

                                                                                        Consider simplifying this complex logical expression.
                                                                                        Open

                                                                                                if (!/\btoken\b/.test(responseType) ||
                                                                                                parseInt(provider.oauth.version, 10) < 2 ||
                                                                                                (opts.display === 'none' && provider.oauth.grant && session && session.refresh_token)) {
                                                                                        
                                                                                                    // Add the oauth endpoints
                                                                                        Severity: Major
                                                                                        Found in app/js/components/hello.all.js - About 40 mins to fix

                                                                                          Function xhr has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                          Open

                                                                                              xhr: function(method, url, headers, data, callback) {
                                                                                          Severity: Minor
                                                                                          Found in app/js/components/hello.all.js - About 35 mins to fix

                                                                                            Function createPhotoUrl has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                            Open

                                                                                                function createPhotoUrl(id, farm, server, secret, size) {
                                                                                            Severity: Minor
                                                                                            Found in app/js/components/hello.all.js - About 35 mins to fix

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

                                                                                                  jsonp: function(url, callback, callbackID, timeout) {
                                                                                              
                                                                                                      var _this = this;
                                                                                                      var error = _this.error;
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.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

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

                                                                                                  diffKey: function(a, b) {
                                                                                                      if (a || !b) {
                                                                                                          var r = {};
                                                                                                          for (var x in a) {
                                                                                                              // Does the property not exist?
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.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

                                                                                              Function hasBinary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                              Open

                                                                                                  hasBinary: function(data) {
                                                                                                      for (var x in data) if (data.hasOwnProperty(x)) {
                                                                                                          if (this.isBinary(data[x])) {
                                                                                                              return true;
                                                                                                          }
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js - About 25 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 bind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                              Open

                                                                                                  Function.prototype.bind = function(b) {
                                                                                              
                                                                                                      if (typeof this !== 'function') {
                                                                                                          throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js - About 25 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 isBinary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                              Open

                                                                                                  isBinary: function(data) {
                                                                                              
                                                                                                      return data instanceof Object && (
                                                                                                      (this.domInstance('input', data) && data.type === 'file') ||
                                                                                                      ('FileList' in window && data instanceof window.FileList) ||
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js - About 25 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 clone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                              Open

                                                                                                  clone: function(obj) {
                                                                                                      // Does not clone DOM elements, nor Binary data, e.g. Blobs, Filelists
                                                                                                      if (obj === null || typeof (obj) !== 'object' || obj instanceof Date || 'nodeName' in obj || this.isBinary(obj) || (typeof FormData === 'function' && obj instanceof FormData)) {
                                                                                                          return obj;
                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js - About 25 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

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                      if (options.height) {
                                                                                                          var dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top;
                                                                                                          var height = screen.height || window.innerHeight || documentElement.clientHeight;
                                                                                                          options.top = parseInt((height - options.height) / 2, 10) + dualScreenTop;
                                                                                                      }
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 2 hrs to fix
                                                                                              app/js/components/hello.all.js on lines 1401..1405

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 92.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                      if (options.width) {
                                                                                                          var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left;
                                                                                                          var width = screen.width || window.innerWidth || documentElement.clientWidth;
                                                                                                          options.left = parseInt((width - options.width) / 2, 10) + dualScreenLeft;
                                                                                                      }
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 2 hrs to fix
                                                                                              app/js/components/hello.all.js on lines 1395..1399

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 92.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                          scope: {
                                                                                                              basic: 'https://www.googleapis.com/auth/plus.me profile',
                                                                                                              email: 'email',
                                                                                                              birthday: '',
                                                                                                              events: '',
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 1 hr to fix
                                                                                              app/js/components/hello.all.js on lines 5495..5509

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 73.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                          scope: {
                                                                                                              basic: 'wl.signin,wl.basic',
                                                                                                              email: 'wl.emails',
                                                                                                              birthday: 'wl.birthday',
                                                                                                              events: 'wl.calendars',
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 1 hr to fix
                                                                                              app/js/components/hello.all.js on lines 3941..3955

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 73.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                  function formatFriends(o) {
                                                                                                      formatError(o);
                                                                                                      paging(o);
                                                                                                      if (o.values) {
                                                                                                          o.data = o.values.map(formatUser);
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 1 hr to fix
                                                                                              app/js/components/hello.all.js on lines 5317..5326

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 69.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                  function formatFriends(o) {
                                                                                                      formatError(o);
                                                                                                      paging(o);
                                                                                                      if (o.users) {
                                                                                                          o.data = o.users.map(formatUser);
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 1 hr to fix
                                                                                              app/js/components/hello.all.js on lines 5029..5038

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 69.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                      if (o && 'meta' in o && 'error_type' in o.meta) {
                                                                                                          o.error = {
                                                                                                              code: o.meta.error_type,
                                                                                                              message: o.meta.error_message
                                                                                                          };
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 1 hr to fix
                                                                                              app/js/components/hello.all.js on lines 5723..5728

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 65.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                      if (o && 'meta' in o && 'error_type' in o.meta) {
                                                                                                          o.error = {
                                                                                                              code: o.meta.error_type,
                                                                                                              message: o.meta.error_message
                                                                                                          };
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 1 hr to fix
                                                                                              app/js/components/hello.all.js on lines 4667..4672

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 65.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                              Open

                                                                                                          scope: {
                                                                                                              basic: 'basic',
                                                                                                              photos: '',
                                                                                                              friends: 'relationships',
                                                                                                              publish: 'likes comments',
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 2 other locations - About 1 hr to fix
                                                                                              app/js/components/angular-chart.js on lines 220..231
                                                                                              app/js/components/hello.all.js on lines 4887..4898

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 56.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                              Open

                                                                                                          scope: {
                                                                                                              basic: 'r_basicprofile',
                                                                                                              email: 'r_emailaddress',
                                                                                                              files: '',
                                                                                                              friends: '',
                                                                                              Severity: Major
                                                                                              Found in app/js/components/hello.all.js and 2 other locations - About 1 hr to fix
                                                                                              app/js/components/angular-chart.js on lines 220..231
                                                                                              app/js/components/hello.all.js on lines 4525..4536

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 56.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                              'meetings/start/scheduled': function(p, callback) {
                                                                                                                  var meetingId = p.data.meetingId;
                                                                                                                  p.data = {};
                                                                                                                  callback('meetings/' + meetingId + '/start');
                                                                                                              },
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 55 mins to fix
                                                                                              app/js/components/hello.all.js on lines 4559..4563

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 54.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                              'me/like': function(p, callback) {
                                                                                                                  var id = p.data.id;
                                                                                                                  p.data = {};
                                                                                                                  callback('media/' + id + '/likes');
                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 55 mins to fix
                                                                                              app/js/components/hello.all.js on lines 4757..4761

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 54.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                              var el = (_this.domInstance('input', data[x]) || _this.domInstance('textArea', data[x]) || _this.domInstance('select', data[x]));
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 40 mins to fix
                                                                                              app/js/components/hello.all.js on lines 2728..2730

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 48.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                                  else if (_this.domInstance('input', data[x]) ||
                                                                                                                      _this.domInstance('select', data[x]) ||
                                                                                                                      _this.domInstance('textArea', data[x])) {
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 40 mins to fix
                                                                                              app/js/components/hello.all.js on lines 2535..2535

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 48.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                          wrap: {
                                                                                                              me: formatUser,
                                                                                                              'me/friends': formatFriends,
                                                                                                              'me/following': formatFriends,
                                                                                                              'me/followers': formatFriends,
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 35 mins to fix
                                                                                              app/js/components/hello.all.js on lines 5554..5564

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 46.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                              Open

                                                                                                          wrap: {
                                                                                                              me: formatUser,
                                                                                              
                                                                                                              'me/friends': formatFriends,
                                                                                                              'me/contacts': formatFriends,
                                                                                              Severity: Minor
                                                                                              Found in app/js/components/hello.all.js and 1 other location - About 35 mins to fix
                                                                                              app/js/components/hello.all.js on lines 3372..3381

                                                                                              Duplicated Code

                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                              Tuning

                                                                                              This issue has a mass of 46.

                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                              Refactorings

                                                                                              Further Reading

                                                                                              There are no issues that match your filters.

                                                                                              Category
                                                                                              Status