fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

    getData: function(url, cb) {

        // find domain and protocol
        var domain, protocol;
        var m = url.toLowerCase().match(/^(https?:\/\/)([^/]+)\/(.)/i);
Severity: Minor
Found in iframely/plugins/custom/domain-icon.js - About 1 hr to fix

    Function generateLinksHtml has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.generateLinksHtml = function(data, options) {
    
        // Links may be grouped.
    
        var links = data.links;
    Severity: Minor
    Found in iframely/lib/utils.js - About 1 hr to fix

      Function formatFriends has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function formatFriends(o, headers, req) {
              paging(o);
              var r = [];
              if ('feed' in o && 'entry' in o.feed) {
                  var token = req.query.access_token;
      Severity: Minor
      Found in app/js/components/hello.all.js - About 1 hr to fix

        Function compile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            compile: function(tElement, tAttrs) {
        
              if (!tAttrs.repeat) throw uiSelectMinErr('repeat', "Expected 'repeat' expression.");
        
              return function link(scope, element, attrs, $select, transcludeFn) {
        Severity: Minor
        Found in app/js/components/select.js - About 1 hr to fix

          Function show has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Drawer.prototype.show = function () {
              if (this.transitioning || this.$element.hasClass('open')) { return; }
          
              var activesData;
              var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing');
          Severity: Minor
          Found in app/js/components/drawer.js - About 1 hr to fix

            Function validateSourceUrl has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        $scope.validateSourceUrl = function() {
                            $scope.currentData = null;
                            $scope.showCurrentData = false;
                            if (!$scope.inputs.url) {
                                $scope.validateStatus = '';
            Severity: Minor
            Found in app/js/directives/add-connection-modal.js - About 1 hr to fix

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

                Function renderObject has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $.fn.renderObject = function(o) {
                
                    function trimString(v) {
                        var MAX = 600;
                        if (typeof v === "string" && v.length > MAX) {
                Severity: Minor
                Found in iframely/static/js/debug.js - About 1 hr to fix

                  Function findAllPluginMethods has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function findAllPluginMethods(pluginId, plugins, result, skipped) {
                  
                      result = result || {
                          mandatory: [],
                          skipped: []
                  Severity: Minor
                  Found in iframely/modules/tests-ui/utils.js - About 1 hr to fix

                    Function getUriStatus has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    exports.getUriStatus = function(uri, options, callback) {
                    
                        if (typeof options === 'function') {
                            callback = options;
                            options = {};
                    Severity: Minor
                    Found in iframely/lib/utils.js - About 1 hr to fix

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

                          prepareLink: function(url, link, options, cb) {
                      
                              // Check if need link processing.
                      
                              if (!link.href) {
                      Severity: Minor
                      Found in iframely/lib/plugins/validators/async/20_checkFavicon.js - About 1 hr to fix

                        Function sendLogToWhitelist has 34 lines of code (exceeds 25 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

                          Consider simplifying this complex logical expression.
                          Open

                                  if (twitter.card === "photo" && twitter.site === '@cloudapp' 
                                      && twitter.image && /^https?:\/\/f\.cl\.ly\//.test(twitter.image.url || twitter.image.src || twitter.image))  {
                          
                                      return {
                                          href: twitter.image.url || twitter.image.src || twitter.image,
                          Severity: Critical
                          Found in iframely/plugins/links/promo/cloudapp-hosted.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                if (h = m && d ? d[m] : _[r]) {
                                                    for (l = h.length - 1; l >= 0; l--)
                                                        h[l].action !== e || i && h[l].context !== i || (p = h.splice(l, 1),
                                                        p[0].action = o.Util.falseFn);
                                                    i && d && 0 === h.length && (delete d[m],
                            Severity: Critical
                            Found in app/js/components/leaflet.js - About 1 hr to fix

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

                                  controller: ['$scope','$timeout', function($scope, $timeout){
                              
                                    var ctrl = this,
                                        $select = $scope.$select,
                                        ngModel;
                              Severity: Minor
                              Found in app/js/components/select.js - About 1 hr to fix

                                Function updateTimeline has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                var updateTimeline = function() {
                                                    console.log("Getting newer tweets");
                                                    hello(auth.network).api('/me/friends').then(function(twitterFriendFeed) {
                                                        // Sort by created time to show on timeline
                                                        twitterFriendFeed.data.sort(function(a,b) {
                                Severity: Minor
                                Found in app/js/directives/signin-twitter.js - About 1 hr to fix

                                  Function getHead has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  var getHead = function(url, options) {
                                  
                                      var req = new events.EventEmitter();
                                  
                                      var options = options || {};
                                  Severity: Minor
                                  Found in iframely/lib/utils.js - About 1 hr to fix

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

                                        getData: function(url, oembedLinks, options, cb) {
                                    
                                            var href = oembedLinks[0].href;
                                    
                                            var skip = false, self_endpoint = false;
                                    Severity: Minor
                                    Found in iframely/lib/plugins/system/oembed/oembed.js - About 1 hr to fix

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

                                          function googleChartApiPromiseFactory($rootScope, $q, apiConfig, googleJsapiUrl) {
                                              var apiReady = $q.defer();
                                              var onLoad = function () {
                                                  // override callback function
                                                  var settings = {
                                      Severity: Minor
                                      Found in app/js/components/ng-google-chart.js - About 1 hr to fix

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

                                        function HarvestingFrequencyService(moment) {
                                        
                                            const MAGIC_NUMBER = 2147483647; // max java int
                                        
                                            var service = {};
                                        Severity: Minor
                                        Found in app/js/services/harvestingFrequency.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language