fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

    getLinks: function(urlMatch, oembed, twitter, options) {

        var links = [];

        if (twitter.image && twitter.image.indexOf && twitter.image.indexOf(urlMatch[1]) > -1) {
Severity: Minor
Found in iframely/plugins/domains/imgur.com.js - About 1 hr to fix

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

            function finish(error, data) {
    
                if (timeout) {
                    clearTimeout(timeout);
                    timeout = null;
    Severity: Minor
    Found in iframely/lib/utils.js - About 1 hr to fix

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

          prepareLink: function(url, link) {
      
              if (link.html || link.template_context || link.template) {
      
              } else {
      Severity: Minor
      Found in iframely/lib/plugins/validators/sync/00_validateLink.js - About 1 hr to fix

        Function AdvancedSearchCtrl has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function AdvancedSearchCtrl($http, $scope, $filter, $location, $stateParams, AppSettings, SearchService, MapPopUpTemplateService, MapCreationService) {
        Severity: Major
        Found in app/js/controllers/advanced-search.js - About 1 hr to fix

          Function findPluginMethods has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function findPluginMethods(pluginId, loadedParams, pluginsUrlMatches, usedMethods, usedParams, methods, scannedPluginsIds, usedDomains, mandatoryParams) {
          Severity: Major
          Found in iframely/lib/core.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 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 _onControlsTap has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var _onControlsTap = function(e) {
                            if(_blockControlsTap) {
                                return true;
                            }
                
                
                Severity: Minor
                Found in app/js/components/photoswipe-ui-default.js - About 1 hr to fix

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

                      var findThumb = function(data) {
                  
                          // Loop round 1 finding thumbnail that also has a social media rel
                          var keepSearching = true;
                          var i = 0;
                  Severity: Minor
                  Found in app/js/directives/debugged-link.js - About 1 hr to fix

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

                        var findThumb = function(data) {
                    
                            // Loop round 1 finding thumbnail that also has a social media rel
                            var keepSearching = true;
                            var i = 0;
                    Severity: Minor
                    Found in app/js/directives/home-debugged-link.js - About 1 hr to fix

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

                      var isAuthorized = function (req, res, next) {
                      
                          function parseAccessToken(accessToken) {
                              var splitted = accessToken.split(":"),
                                  oauth_token = splitted[0],
                      Severity: Minor
                      Found in oauth-proxy/api.js - About 1 hr to fix

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

                            getData: function (url, urlMatch, request, cb) {
                        
                                request({
                                    uri: "https://api.vk.com/method/wall.getById", //?posts=-76229642_10505
                                    qs: {
                        Severity: Minor
                        Found in iframely/plugins/domains/vk.com/vk.status.js - About 1 hr to fix

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

                              getLink: function(cheerio) {
                          
                                  var videoObjectSchema = 'VideoObject';
                          
                                  var $scope = cheerio('[itemscope][itemtype*="' + videoObjectSchema + '"]');
                          Severity: Minor
                          Found in iframely/plugins/domains/cbsnews.com.js - About 1 hr to fix

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

                                function _findKeyMeta(k) {
                            
                                    var _ = require('underscore');
                            
                                    var sk = safeKey(k);
                            Severity: Minor
                            Found in iframely/lib/cache-engines/memcached.js - About 1 hr to fix

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

                              function findBestMedia(m1, m2) {
                              
                                  if (!m1 && !m2) {
                                      return m1;
                                  }
                              Severity: Minor
                              Found in iframely/lib/plugins/validators/sync/07_duplicateLink.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 getData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    getData: function(url, og, whitelistRecord) {
                                
                                        // do not process if there is a whitelist record for this domain as processing will take longer
                                        if (!whitelistRecord.isDefault && whitelistRecord.isAllowed && whitelistRecord.isAllowed('og.video')) {return;}
                                        
                                Severity: Minor
                                Found in iframely/plugins/links/promo/og-youtube.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 getLink has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    getLink: function(meta) {
                                
                                        function findIcons(links, filter) {
                                            var key, l;
                                
                                
                                Severity: Minor
                                Found in iframely/plugins/links/favicon.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 getLink has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    getLink: function (meta, whitelistRecord) {
                                
                                        if (meta.video_src && whitelistRecord.isAllowed && whitelistRecord.isAllowed('html-meta.video')) {
                                        
                                            var player = {
                                Severity: Minor
                                Found in iframely/plugins/links/video_src.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 getLink has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    getLink: function(meta) {
                                
                                        var href = meta.video_src.href || meta.video_src;
                                
                                        if (href && /\.mp4$/.test(href)) {
                                Severity: Minor
                                Found in iframely/plugins/domains/t-online.de.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

                                Severity
                                Category
                                Status
                                Source
                                Language