fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

        controller: function($scope) {
            $scope.showDetail = false;
            $scope.showMoreAction = false;
            $scope.debuggable = true;
             
Severity: Minor
Found in app/js/directives/status.js - About 1 hr to fix

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

        function getPlayer(iframely_data, options) {
    
            var html5video = false;
    
            function findPlayer(l) {
    Severity: Minor
    Found in iframely/lib/html-utils.js - About 1 hr to fix

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

      function findUsedMethods(options, debugData, result) {
      
          // Find debug data for specific link.
      
          result = result || [];
      Severity: Minor
      Found in iframely/modules/tests-ui/utils.js - About 1 hr to fix

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

                    prepareResult: function(error, b, data, cb) {
        
                        if (error) {
                            return cb(error);
                        }
        Severity: Minor
        Found in iframely/plugins/domains/youtube.com/youtube.video.js - About 1 hr to fix

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

              exports.filterLinksByRel = function(rel, links, options) {
          
                  var options = options || {};
          
                  if (typeof rel == "string") {
          Severity: Minor
          Found in iframely/lib/html-utils.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 MapCreationService has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            function MapCreationService($rootScope, MapPopUpTemplateService, SearchService) {
            
                var service = {};
                var attribution = 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
                    '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
            Severity: Minor
            Found in app/js/services/mapcreation.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 getLinks has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                getLinks: function(tumblr_post, cb) {
            
                    if (tumblr_post.type !== "video") {
                        cb(null);
                    }
            Severity: Minor
            Found in iframely/plugins/domains/tumblr.com/tumblr.video.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 15 (exceeds 5 allowed). Consider refactoring.
            Open

                getLink: function(twitter) {
            
                    if (twitter.card !== 'player' || !twitter.player) {
            
                        return;
            Severity: Minor
            Found in iframely/plugins/domains/archive.org.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 prepareLink has a Cognitive Complexity of 15 (exceeds 5 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

            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 sendLogToWhitelist has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.sendLogToWhitelist = function(uri, meta, oembed, whitelistRecord) {
            
                if (!CONFIG.WHITELIST_LOG_URL) {
                    return
                }
            Severity: Minor
            Found in iframely/lib/utils.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 getLinks has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getLinks: function (meta, oembed, options, cb) {
            
                    // When there is no project video, Kikstarter's oEmbed has diff output
                    // 'meta' param is there to determine if there's a video
                    // oembed thumbnail is returned as link and not as mixin to avoid empty results and fallback to generic parsers
            Severity: Minor
            Found in iframely/plugins/domains/kickstarter.com.js - About 1 hr to fix

              Function getContentType has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.getContentType = function(uriForCache, uriOriginal, options, cb) {
              
                  cache.withCache("content-type:" + uriForCache, function(cb) {
              
                      var timeout, requestInstance, totalTime;
              Severity: Minor
              Found in iframely/lib/utils.js - About 1 hr to fix

                Function select has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  ctrl.select = function(item, skipFocusser, $event) {
                    if (item === undefined || !item._uiSelectChoiceDisabled) {
                
                      if ( ! ctrl.items && ! ctrl.search ) return;
                
                
                Severity: Minor
                Found in app/js/components/select.js - About 1 hr to fix

                  Function PushService has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function PushService($q, $http, AppSettings, $rootScope) {
                  
                      var service = {};
                  
                      service.pushData = undefined;
                  Severity: Minor
                  Found in app/js/services/push.js - About 1 hr to fix

                    Function getLinks has 46 lines of code (exceeds 25 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 1 hr to fix

                      Function sortLinks has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var sortLinks = exports.sortLinks = function(links, autoplay_first) {
                      
                              function sortLinksInner(l1, l2) {
                      
                                  var non_responsive_1 = l1.media && l1.media['width'] && l1.media['height'];
                      Severity: Minor
                      Found in iframely/lib/html-utils.js - About 1 hr to fix

                        Function wrapContainer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function wrapContainer($element, data) {
                        
                                var media = data.media;
                        
                                if (media && media.height && media.width && !media["aspect-ratio"]) {
                        Severity: Minor
                        Found in iframely/lib/html-utils.js - About 1 hr to fix

                          Function filterLinksByRel has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              $.iframely.filterLinksByRel = function(rel, links, options) {
                          
                                  var options = options || {};
                          
                                  if (typeof rel == "string") {
                          Severity: Minor
                          Found in iframely/static/js/iframely.js - About 1 hr to fix

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

                                getData: function(url, urlMatch, options, cb) {
                            
                                    if (!options.getProviderOptions('google.maps_key')) {
                                        return cb (new Error ("No google.maps_key configured"));
                                    }
                            Severity: Minor
                            Found in iframely/plugins/domains/google.com/google.maps.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language