fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

              getLinks: function(url, youtube_video_gdata, options) {
          
                  var params = options.getProviderOptions('youtube.get_params', '');
          
                  /** Extract ?t=12m15s, ?t=123, ?start=123, ?stop=123, ?end=123
          Severity: Major
          Found in iframely/plugins/domains/youtube.com/youtube.video.js - About 2 hrs to fix

            Function getOembed has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports.getOembed = function(uri, options, callback) {
            
                if (typeof options === 'function') {
                    callback = options;
                    options = null;
            Severity: Major
            Found in iframely/lib/plugins/system/oembed/oembedUtils.js - About 2 hrs to fix

              File advanced-search.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              /* global angular, L */
              /* jshint unused:false */
              
              var controllersModule = require('./_index');
              Severity: Minor
              Found in app/js/controllers/advanced-search.js - About 2 hrs to fix

                File signin-twitter.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                'use strict';
                /* global angular, $ */
                /* jshint unused:false */
                
                var directivesModule = require('./_index.js');
                Severity: Minor
                Found in app/js/directives/signin-twitter.js - About 2 hrs to fix

                  Function generate has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              generate: function(data, options) {
                  
                                  var iframelyData = options && options.iframelyData;
                  
                                  var givf = data.rel.indexOf('gifv') > -1;
                  Severity: Major
                  Found in iframely/lib/html-utils.js - About 2 hrs to fix

                    Function generate has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                generate: function(data, options) {
                    
                                    var iframelyData = options && options.iframelyData;
                    
                                    var givf = data.rel.indexOf('gifv') > -1;
                    Severity: Major
                    Found in iframely/static/js/iframely.js - About 2 hrs to fix

                      Function prepareResultData has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function prepareResultData(uri, result, options) {
                      
                              if (!options.debug) {
                                  // TODO: deep clean?
                                  delete result.allData;
                      Severity: Major
                      Found in iframely/lib/core.js - About 2 hrs to fix

                        Function runPostPlugins has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function runPostPlugins(link, dataRecord, usedMethods, context, pluginsContexts, asyncMethodCb) {
                        
                                for(var i = 0; i < postPluginsList.length; i++) {
                                    (function() {
                        
                        
                        Severity: Major
                        Found in iframely/lib/core.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (data.items && data.items.length > 0) {
                          
                                              var entry = data.items[0];
                          
                                              var duration = 0;
                          Severity: Critical
                          Found in iframely/plugins/domains/youtube.com/youtube.video.js - About 2 hrs to fix

                            File utils.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            (function() {
                            
                                GLOBAL.CONFIG = require('./config');
                            
                                var async = require('async');
                            Severity: Minor
                            Found in iframely/utils.js - About 2 hrs to fix

                              Function getLink has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getLink: function(urlMatch, og, options, cb) {
                              
                              
                                      if (!og.image) {
                                          cb('OG image not available');            
                              Severity: Minor
                              Found in iframely/plugins/domains/geogebra.org.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 c has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function c(e) {
                                      function t(e) {
                                          return e && e.source || e
                                      }
                                      function r(r, a) {
                              Severity: Major
                              Found in app/js/components/highlight.js - About 2 hrs to fix

                                Function SourceTypeService has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function SourceTypeService() {
                                
                                    var service = {};
                                
                                    service.sourceTypeList =
                                Severity: Major
                                Found in app/js/services/sourceType.js - About 2 hrs to fix

                                  Function controller has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          controller: function($scope, $element, $attrs) {
                                              $scope.comment = "";
                                              $scope.remainingChars = 140;
                                              $scope.status = {};
                                  
                                  
                                  Severity: Major
                                  Found in app/js/directives/retweet-modal.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language