fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

        ui.init = function() {
    
            // extend options
            framework.extend(pswp.options, _defaultUIOptions, true);
    
    
    Severity: Major
    Found in app/js/components/photoswipe-ui-default.js - About 3 hrs to fix

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

      HTMLMetaHandler.prototype.onopentag = function(name, attributes) {
      
          if (this._end) return;
      
          name = name.toUpperCase();
      Severity: Major
      Found in iframely/lib/plugins/system/meta/HTMLMetaHandler.js - About 3 hrs to fix

        Function getLinks has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            getLinks: function(meta, options) {
        
                if (!/bandcamp/i.test(meta.twitter && meta.twitter.site || meta.generator)) {
                    return;
                }
        Severity: Minor
        Found in iframely/plugins/domains/bandcamp.com.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 scanModulesForPlugins has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function scanModulesForPlugins() {
        
                // Scan node_modules dir.
                var modulesRootPath = path.resolve('node_modules');
                var modules_listing = fs.readdirSync(modulesRootPath).map(function(module_name) { return path.resolve(modulesRootPath, module_name); });
        Severity: Major
        Found in iframely/lib/loader/pluginLoader.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 getMeta has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              getMeta: function(meta) {
          
                  function getAttr(attr) {
          
                      var root = meta.dc || meta.dcterms, key;
          Severity: Minor
          Found in iframely/plugins/meta/dc.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 getLinks has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              getLinks: function(twitter, meta, whitelistRecord) {
          
                  var links = [];
          
                  if (twitter.card === "gallery") {
          Severity: Minor
          Found in iframely/plugins/links/twitter-image.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 formatManagerFactory has 81 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function formatManagerFactory(){
                      // Handles the processing of Google Charts API Formats
                      function FormatManager(){
                          var self = this;
                          var oldFormatTemplates = {};
          Severity: Major
          Found in app/js/components/ng-google-chart.js - About 3 hrs to fix

            Function merge has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function merge(parentObj, props, value) {
            
                /*
                Test urls:
                 http://www.travelchannel.com/video/its-a-real-life-video-game
            Severity: Major
            Found in iframely/lib/plugins/system/meta/HTMLMetaHandler.js - About 3 hrs to fix

              File views.js has 301 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              var iframelyCore = require('../../lib/core');
              var utils = require('../../utils');
              var _ = require('underscore');
              var async = require('async');
              var cache = require('../../lib/cache');
              Severity: Minor
              Found in iframely/modules/api/views.js - About 3 hrs to fix

                Function calculateTerm has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function calculateTerm(argument) {
                        term = "";
                
                        var i;
                        for (i = 0; i < vm.wallOptions.all.length; i++) {
                Severity: Major
                Found in app/js/controllers/wallDisplay.js - About 3 hrs to fix

                  Function FormatManager has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function FormatManager(){
                                  var self = this;
                                  var oldFormatTemplates = {};
                                  self.iFormats = {}; // Holds instances of formats (ie. self.iFormats.date[0] = new google.visualization.DateFormat(params))
                                  self.applyFormats = applyFormats;
                  Severity: Major
                  Found in app/js/components/ng-google-chart.js - About 3 hrs to fix

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

                            controller: function($scope, $element, $attrs) {
                                $rootScope.root.haveSearchSuggestion = false;
                                $rootScope.root.lastSearchTimeStamp = new Date();
                                $rootScope.root.selectedTermIndex = -1;
                                $rootScope.root.searchSuggestions = [];
                    Severity: Major
                    Found in app/js/directives/globalSearchForm.js - About 3 hrs to fix

                      Function _finalMerge has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      HTMLMetaHandler.prototype._finalMerge = function() {
                      
                          this._end = true;
                      
                          var that = this;
                      Severity: Major
                      Found in iframely/lib/plugins/system/meta/HTMLMetaHandler.js - About 3 hrs to fix

                        Function useResult has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function useResult(usedMethods, context, pluginsContexts, allResults, result, options, asyncMethodCb) {
                        
                                if (!result) {
                                    return false;
                                }
                        Severity: Major
                        Found in iframely/lib/core.js - About 3 hrs to fix

                          Function getData has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getData: function(url, meta, whitelistRecord) {
                          
                                  if (!whitelistRecord.isDefault && ((meta.og && meta.og.image) || (meta.twitter && meta.twitter.image))) {return;}
                          
                                  if (url.match(/^https?:\/\/link\.brightcove\.(?:com|co\.jp)\/services\/player\/bcpid(\d+)\?/i)) {return;}
                          Severity: Minor
                          Found in iframely/plugins/links/promo/brightcove-hosted.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 getLink has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getLink: function(schemaVideoObject, whitelistRecord) {
                          
                                  if (schemaVideoObject.embedURL || schemaVideoObject.embedUrl) {
                          
                                      var type = CONFIG.T.maybe_text_html;
                          Severity: Minor
                          Found in iframely/plugins/links/embedURL/embedURL.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 getLinks has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getLinks: function(gmap, options) {
                          
                                  if (!gmap.mode) {
                                      return;
                                  }
                          Severity: Minor
                          Found in iframely/plugins/domains/google.com/google.maps.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 callback has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          function callback(error, data) {
                          
                                              if (!timeout) {
                                                  // TODO: log response error after timeout?
                                                  return;
                          Severity: Major
                          Found in iframely/modules/tests-ui/tester.js - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language