fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

    getData: function(url, twitter, 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('twitter.player')) {return;}

Severity: Minor
Found in iframely/plugins/links/promo/twitter-youtube.js - About 1 hr to fix

    Function onGlobalTap has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ui.onGlobalTap = function(e) {
            e = e || window.event;
            var target = e.target || e.srcElement;
    
            if(_blockControlsTap) {
    Severity: Minor
    Found in app/js/components/photoswipe-ui-default.js - About 1 hr to fix

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

          getLinks: function(tumblr_post) {
      
              if (tumblr_post.type !== "photo") {
                  return;
              }
      Severity: Minor
      Found in iframely/plugins/domains/tumblr.com/tumblr.photo.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 getLink has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            getLink: function(oembed, whitelistRecord) {
        
        
                if (!(oembed.type === "video" && whitelistRecord.isAllowed && whitelistRecord.isAllowed('oembed.video'))) {
                    return;
        Severity: Minor
        Found in iframely/plugins/links/oembed-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 getData has a Cognitive Complexity of 11 (exceeds 5 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

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

        var prepareRequestOptions = exports.prepareRequestOptions = function(request_options) {
        
            if (CONFIG.PROXY) {
        
                var url = request_options.uri || request_options.url;
        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 findOembedLinks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports.findOembedLinks = function(uri, meta) {
            // Filter oembed from meta.
            var alternate = meta && meta.alternate;
            if (alternate && !(alternate instanceof Array)) {
                alternate = [alternate];
        Severity: Minor
        Found in iframely/lib/plugins/system/oembed/oembedUtils.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 11 (exceeds 5 allowed). Consider refactoring.
        Open

            prepareLink: function(url, link, options, cb) {
        
                // Check if need link processing.
        
                function finish() {
        Severity: Minor
        Found in iframely/lib/plugins/validators/async/21_checkFlash.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 callCb has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        CollectingHandlerForMutliTarget.prototype.callCb = function(event, cbs) {
        
            function cb(cbs) {
        
                if (cbs[event[0]]) {

        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 11 (exceeds 5 allowed). Consider refactoring.
        Open

            prepareLink: function(link, pluginContext) {
        
                if (!link.href) {
                    return;
                }
        Severity: Minor
        Found in iframely/lib/plugins/validators/sync/07_duplicateLink.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 $get has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function($rootScope, $log, $interval, $http) {
        
                var state = {
                  ping: null
                };
        Severity: Minor
        Found in app/js/components/angular-idle.js - About 1 hr to fix

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

                  return function link(scope, element, attrs, $select, transcludeFn) {
            
                    // var repeat = RepeatParser.parse(attrs.repeat);
                    var groupByExp = attrs.groupBy;
                    var groupFilterExp = attrs.groupFilter;
            Severity: Minor
            Found in app/js/components/select.js - About 1 hr to fix

              Function validateConfiguration has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    var validateConfiguration = function validateConfiguration(configuration) {
                      var validOptions = ['startView', 'minView', 'minuteStep', 'dropdownSelector'];
              
                      for (var prop in configuration) {
                        //noinspection JSUnfilteredForInLoop
              Severity: Minor
              Found in app/js/components/datetimepicker.js - About 1 hr to fix

                Function addPointerListenerStart has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        addPointerListenerStart: function(t, i, n, s) {
                            var a = "_leaflet_"
                              , r = this._pointers
                              , h = function(t) {
                                o.DomEvent.preventDefault(t);
                Severity: Minor
                Found in app/js/components/leaflet.js - About 1 hr to fix

                  Function extend has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      o.Class.extend = function(t) {
                          var e = function() {
                              this.initialize && this.initialize.apply(this, arguments),
                              this._initHooks && this.callInitHooks()
                          }
                  Severity: Minor
                  Found in app/js/components/leaflet.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 getViewportOffset has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              getViewportOffset: function(t) {
                                  var i, n = 0, s = 0, a = t, r = e.body, h = e.documentElement;
                                  do {
                                      if (n += a.offsetTop || 0,
                                      s += a.offsetLeft || 0,
                      Severity: Minor
                      Found in app/js/components/leaflet.js - About 1 hr to fix

                        Function z has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        router.put('/:user/:app/:id', isAuthorized, function z(req, res) {
                            getData(req.params.user, function (error, response, body) {
                                var responseData = JSON.parse(response.body),
                                    appData = responseData.accounts[0].apps,
                                    authData = {},
                        Severity: Minor
                        Found in oauth-proxy/api.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language