fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

Function append has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    append: function(node, attr, target) {

        var n = typeof (node) === 'string' ? document.createElement(node) : node;

        if (typeof (attr) === 'object') {
Severity: Minor
Found in app/js/components/hello.all.js - About 1 hr to fix

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

        getLink: function(urlMatch, request, cb) {
            var gistId = urlMatch[2];
            var filePermalink = urlMatch[4];
    
            if (!filePermalink) {
    Severity: Minor
    Found in iframely/plugins/domains/github.gist.js - About 1 hr to fix

      Function WallDisplay has 13 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function WallDisplay($scope, $stateParams, $interval, $timeout, $location, $http, $window, $resource, AppSettings, SearchService, StatisticsService, AppsService, Fullscreen) {
      Severity: Major
      Found in app/js/controllers/wallDisplay.js - About 1 hr to fix

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

            controller: ['$scope', '$element'].concat(function($scope, $element){
              $scope.btntype = $element.attr('btn-type');
              $scope.node = this.node = {
                d: {},
                add: function(e, a){
        Severity: Minor
        Found in app/js/components/ui-choices.js - About 1 hr to fix

          Function otherDropdown has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          $.fn.otherDropdown = function(options) {
              var $this = this;
              // Allow a different name/value to trigger, default to 'other'
              var opts = $.extend({}, {value: 'other'}, options);
              opts.name_lower = opts.value.toLowerCase();
          Severity: Minor
          Found in app/js/components/jquery.otherDropdown.js - About 1 hr to fix

            Function cbOnMap has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    var cbOnMap = function() {
                        var hintText = '<p class="map-control-hint-text">The first number shows the actual followers. The second number shows the number of followers with a location info. These are displayed on the map.</p>';
                        $(".leaflet-control-layers-overlays").append(hintText);
                        $(".map-control-hint").hover(function() {
                            $(".map-control-hint-text").show();
            Severity: Minor
            Found in app/js/controllers/map.js - About 1 hr to fix

              Function link has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        link: function (scope, elem/*, attrs */) {
                          var chart, container = document.createElement('div');
              
                          function resetChart (newVal, oldVal) {
                            if (isEmpty(newVal)) { return; }
              Severity: Minor
              Found in app/js/components/angular-chart.js - About 1 hr to fix

                Function genUserInfoPopUp has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  service.genUserInfoPopUp = function(status) {
                    var result = "Failed loading data from twitter";
                    var title;
                
                    if (status.isAFollower && status.isAFollowing) {
                Severity: Minor
                Found in app/js/services/MapPopUpTemplate.js - About 1 hr to fix

                  Function addDoubleTapListener has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          addDoubleTapListener: function(t, i, n) {
                              function s(t) {
                                  var e;
                                  if (o.Browser.pointer ? (_.push(t.pointerId),
                                  e = _.length) : e = t.touches.length,
                  Severity: Minor
                  Found in app/js/components/leaflet.js - About 1 hr to fix

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

                      Function buildScript has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function buildScript(file) {
                      
                        var bundler = browserify({
                          entries: config.browserify.entries,
                          debug: true,
                      Severity: Minor
                      Found in gulp/tasks/browserify.js - About 1 hr to fix

                        Function link has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                link: function(scope, element) {
                                    /**
                                     * Take the embeded link
                                     *     Pic.twitter.com is already render in images and is not processed again
                                     * Debug the link with injected service
                        Severity: Minor
                        Found in app/js/directives/debugged-link.js - About 1 hr to fix

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

                            Function moveMediaAttrs has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function moveMediaAttrs(link) {
                            
                                if (!link.media) {
                                    var m = {};
                                    // TODO: make for()
                            Severity: Minor
                            Found in iframely/lib/plugins/validators/media.js - About 1 hr to fix

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

                                  getData: function(oembedLinks, whitelistRecord) {
                              
                                      if (whitelistRecord.isAllowed && whitelistRecord.isAllowed('html-meta.promo')) {        
                              
                                          var href = oembedLinks[0].href;
                              Severity: Minor
                              Found in iframely/plugins/links/promo/promo-oembed.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 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getLink: function(urlMatch, schemaFileObject) {
                              
                                      if (schemaFileObject.embedURL || schemaFileObject.embedUrl) {
                              
                                          var file = {
                              Severity: Minor
                              Found in iframely/plugins/domains/google.com/docs.google.com.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 testAll has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function testAll(cb) {
                              
                                  // Get all plugins with tests.
                                  var pluginsList = _.values(plugins).filter(function(plugin) {
                              
                              
                              Severity: Minor
                              Found in iframely/modules/tests-ui/tester.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 findBestMedia has a Cognitive Complexity of 13 (exceeds 5 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

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

                                      dataToJSON: function(p) {
                              
                                          var _this = this;
                                          var w = window;
                                          var data = p.data;
                              Severity: Minor
                              Found in app/js/components/hello.all.js - About 1 hr to fix

                                Function fetchFeedUrls has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                var fetchFeedUrls = exports.fetchFeedUrls = function(feedUrl, options, cb) {
                                
                                    if (typeof options === "function") {
                                        cb = options;
                                        options = {};
                                Severity: Minor
                                Found in iframely/modules/tests-ui/utils.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language