fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

    getLink: function(url, options) {
        url = URL.parse(url,true);

        var query = url.query;

Severity: Major
Found in iframely/plugins/domains/google.com/maps.google.com.js - About 4 hrs to fix

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

        link: function(scope, element, attrs, $select) {
          if (scope[attrs.uiSelectSort] === null) {
            throw uiSelectMinErr('sort', "Expected a list to sort");
          }
    
    
    Severity: Major
    Found in app/js/components/select.js - About 4 hrs to fix

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

          link: function(s, e, a){
            var that, update;
            if (!e.hasClass('ui')) {
              e.addClass('btn-group');
            }
      Severity: Major
      Found in app/js/components/ui-choices.js - About 3 hrs to fix

        Function getOembed has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.getOembed = function(uri, data, options) {
        
            if (!data) {
                return;
            }
        Severity: Major
        Found in iframely/lib/oembed.js - About 3 hrs to fix

          Function MapPopUpTemplateService has 95 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function MapPopUpTemplateService($filter, SourceTypeService, JsonFieldAccessorService, RichTextService) {
          
            var service = {};
          
            service.genImportedStatus = function(status, profile) {
          Severity: Major
          Found in app/js/services/MapPopUpTemplate.js - About 3 hrs to fix

            Function getImageMetadata has 94 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.getImageMetadata = function(uri, options, callback){
            
                if (typeof options === 'function') {
                    callback = options;
                    options = {};
            Severity: Major
            Found in iframely/lib/utils.js - About 3 hrs to fix

              Function getMeta has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  getMeta: function(meta, url) {
              
                      // Player.
              
                      var has_player = false;
              Severity: Minor
              Found in iframely/plugins/meta/media-detector.js - About 3 hrs 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 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  getLinks: function(url, youtube_video_gdata, options) {
              
                      var params = options.getProviderOptions('youtube.get_params', '');
              
                      /** Extract ?t=12m15s, ?t=123, ?start=123, ?stop=123, ?end=123
              Severity: Minor
              Found in iframely/plugins/domains/youtube.com/youtube.video.js - About 3 hrs 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

              Consider simplifying this complex logical expression.
              Open

                          if (!i.compiled) {
                              if (i.compiled = !0,
                              i.k = i.k || i.bK,
                              i.k) {
                                  var s = {}
              Severity: Critical
              Found in app/js/components/highlight.js - About 3 hrs to fix

                Function createModule has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                   var createModule = function(angular) {
                      var module = angular.module('FBAngular', []);
                
                      module.factory('Fullscreen', ['$document', '$rootScope', function ($document,$rootScope) {
                         var document = $document[0];
                Severity: Major
                Found in app/js/components/angular-fullscreen.js - About 3 hrs to fix

                  File datetimepicker.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*globals define, jQuery, module, require */
                  /*jslint vars:true */
                  
                  /**
                   * @license angular-bootstrap-datetimepicker  version: 0.3.12
                  Severity: Minor
                  Found in app/js/components/datetimepicker.js - About 3 hrs to fix

                    Function mapLayoutDirective has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function mapLayoutDirective(MapPopUpTemplateService, $interval, $location, MapCreationService) {
                    
                        return {
                            scope: {
                                data: '=',
                    Severity: Minor
                    Found in app/js/directives/mapLayout.js - About 3 hrs 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 25 (exceeds 5 allowed). Consider refactoring.
                    Open

                        getLink: function(oembed, whitelistRecord) {
                    
                    
                            if (!(oembed.type === "rich" && whitelistRecord.isAllowed && whitelistRecord.isAllowed('oembed.rich'))) {
                                return;
                    Severity: Minor
                    Found in iframely/plugins/links/oembed-rich.js - About 3 hrs 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 merge has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function merge(parentObj, props, value) {
                    
                        /*
                        Test urls:
                         http://www.travelchannel.com/video/its-a-real-life-video-game
                    Severity: Minor
                    Found in iframely/lib/plugins/system/meta/HTMLMetaHandler.js - About 3 hrs 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 link has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        link: function(scope, element, attrs, ctrls) {
                    
                          var $select = ctrls[0];
                          var ngModel = ctrls[1];
                    
                    
                    Severity: Major
                    Found in app/js/components/select.js - About 3 hrs to fix

                      Function Routes has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Routes($stateProvider, $locationProvider, $urlRouterProvider, $httpProvider, cfpLoadingBarProvider) {
                        $locationProvider.html5Mode(true);
                      
                        $stateProvider
                        .state('Home', {
                      Severity: Major
                      Found in app/js/routes.js - About 3 hrs to fix

                        Function runMethods has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function runMethods(methods, context, pluginsUrlMatches, options, asyncMethodCb) {
                        
                                // Sync results list.
                                var results = [];
                        
                        
                        Severity: Major
                        Found in iframely/lib/core.js - About 3 hrs to fix

                          File HTMLMetaHandler.js has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          var decodeHTML5 = require('entities').decodeHTML5;
                          var _ = require('underscore');
                          var url = require('url');
                          
                          var utils = require('../../../utils');
                          Severity: Minor
                          Found in iframely/lib/plugins/system/meta/HTMLMetaHandler.js - About 3 hrs to fix

                            Function Promise has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                Promise: (function(){
                                    /*  promise states [Promises/A+ 2.1]  */
                                    var STATE_PENDING   = 0;                                         /*  [Promises/A+ 2.1.1]  */
                                    var STATE_FULFILLED = 1;                                         /*  [Promises/A+ 2.1.2]  */
                                    var STATE_REJECTED  = 2;                                         /*  [Promises/A+ 2.1.3]  */
                            Severity: Major
                            Found in app/js/components/hello.all.js - About 3 hrs to fix

                              File search.js has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              'use strict';
                              /* global angular, L, map */
                              /* jshint unused:false */
                              
                              var controllersModule = require('./_index');
                              Severity: Minor
                              Found in app/js/controllers/search.js - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language