fossasia/loklak_webclient

View on GitHub

Showing 915 of 915 total issues

File highlight.js has 7027 lines of code (exceeds 250 allowed). Consider refactoring.
Open

!function(e) {
    "undefined" != typeof exports ? e(exports) : (window.hljs = e({}),
    "function" == typeof define && define.amd && define("hljs", [], function() {
        return window.hljs
    }
Severity: Major
Found in app/js/components/highlight.js - About 2 wks to fix

    File leaflet.js has 5216 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com
     (c) 2010-2013, Vladimir Agafonkin
     (c) 2010-2011, CloudMade
    */
    Severity: Major
    Found in app/js/components/leaflet.js - About 2 wks to fix

      File hello.all.js has 3731 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*! hellojs v1.12.0 | (c) 2012-2016 Andrew Dodson | MIT https://adodson.com/hello.js/LICENSE */
      // ES5 Object.create
      if (!Object.create) {
      
          // Shim, Object create
      Severity: Major
      Found in app/js/components/hello.all.js - About 1 wk to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            $rootScope.root.postTweet = function() {
        
                var message = $rootScope.root.tweet;
                var tweetLen = twttr.txt.getTweetLength(message);
                var tweet = encodeURIComponent(message);
        Severity: Major
        Found in app/js/controllers/tweet.js and 1 other location - About 1 wk to fix
        app/js/directives/tweet-feature-drt.js on lines 27..205

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 1669.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                     $rootScope.root.postTweet = function() {
        
                         var message = $rootScope.root.tweet;
                         var tweetLen = twttr.txt.getTweetLength(message);
                         var tweet = encodeURIComponent(message);
        Severity: Major
        Found in app/js/directives/tweet-feature-drt.js and 1 other location - About 1 wk to fix
        app/js/controllers/tweet.js on lines 25..202

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 1669.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function WallDisplay has a Cognitive Complexity of 195 (exceeds 5 allowed). Consider refactoring.
        Open

        function WallDisplay($scope, $stateParams, $interval, $timeout, $location, $http, $window, $resource, AppSettings, SearchService, StatisticsService, AppsService, Fullscreen) {
        
            var vm, flag, allStatuses, nextStatuses, term, count, searchParams, maxStatusCount;
            vm = this;
            vm.invalidId = false;
        Severity: Minor
        Found in app/js/controllers/wallDisplay.js - About 3 days 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

        File select.js has 1348 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
         * ui-select
         * http://github.com/angular-ui/ui-select
         * Version: 0.12.1 - 2015-07-28T03:50:59.076Z
         * License: MIT
        Severity: Major
        Found in app/js/components/select.js - About 3 days to fix

          Function PhotoSwipeUI_Default has 640 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

           function(pswp, framework) {
          
              var ui = this;
              var _overlayUIUpdated = false,
                  _controlsVisible = true,
          Severity: Major
          Found in app/js/components/photoswipe-ui-default.js - About 3 days to fix

            File core.js has 857 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function(core) {
            
                var _ = require('underscore'),
                    request = require('request'),
                    urlLib = require('url');
            Severity: Major
            Found in iframely/lib/core.js - About 2 days to fix

              Function WallDisplay has 403 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function WallDisplay($scope, $stateParams, $interval, $timeout, $location, $http, $window, $resource, AppSettings, SearchService, StatisticsService, AppsService, Fullscreen) {
              
                  var vm, flag, allStatuses, nextStatuses, term, count, searchParams, maxStatusCount;
                  vm = this;
                  vm.invalidId = false;
              Severity: Major
              Found in app/js/controllers/wallDisplay.js - About 2 days to fix

                File marked.js has 824 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * marked - a markdown parser
                 * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
                 * https://github.com/chjj/marked
                 */
                Severity: Major
                Found in app/js/components/marked.js - About 1 day to fix

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      var findThumb = function(data) {
                  
                          // Loop round 1 finding thumbnail that also has a social media rel
                          var keepSearching = true;
                          var i = 0;
                  Severity: Major
                  Found in app/js/directives/debugged-link.js and 1 other location - About 1 day to fix
                  app/js/directives/home-debugged-link.js on lines 52..85

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 320.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      var findThumb = function(data) {
                  
                          // Loop round 1 finding thumbnail that also has a social media rel
                          var keepSearching = true;
                          var i = 0;
                  Severity: Major
                  Found in app/js/directives/home-debugged-link.js and 1 other location - About 1 day to fix
                  app/js/directives/debugged-link.js on lines 59..92

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 320.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          request({
                              uri: "https://api.vk.com/method/wall.getById", //?posts=-76229642_10505
                              qs: {
                                  posts: urlMatch[1] + '_' +urlMatch[2]
                              },
                  Severity: Major
                  Found in iframely/plugins/domains/vk.com/vk.status.js and 1 other location - About 1 day to fix
                  app/js/components/leaflet.js on lines 167..172

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 301.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function datetimepickerDirective has 297 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      .directive('datetimepicker', ['$log', 'dateTimePickerConfig', function datetimepickerDirective($log, defaultConfig) {
                  
                        function DateObject() {
                  
                          var tempDate = new Date();
                  Severity: Major
                  Found in app/js/components/datetimepicker.js - About 1 day to fix

                    File photoswipe-ui-default.js has 655 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*! PhotoSwipe Default UI - 4.0.7 - 2015-03-18
                    * http://photoswipe.com
                    * Copyright (c) 2015 Dmitry Semenov; */
                    /**
                    *
                    Severity: Major
                    Found in app/js/components/photoswipe-ui-default.js - About 1 day to fix

                      Function post has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
                      Open

                          post: function(url, data, options, callback, callbackID, timeout) {
                      
                              var _this = this;
                              var error = _this.error;
                              var doc = document;
                      Severity: Minor
                      Found in app/js/components/hello.all.js - About 1 day 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 AdvancedSearchCtrl has 275 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function AdvancedSearchCtrl($http, $scope, $filter, $location, $stateParams, AppSettings, SearchService, MapPopUpTemplateService, MapCreationService) {
                      
                          var vm = this;
                          var map = false;
                          var prevZoomAction, prevPanAction, newZoomAction, newPanAction;
                      Severity: Major
                      Found in app/js/controllers/advanced-search.js - About 1 day to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                            var windowMessaging = function(){
                        
                                return {
                                    postMessage : function(message, target_url, target) {
                        
                        
                        Severity: Major
                        Found in iframely/static/js/iframely-for-iframe.js and 1 other location - About 1 day to fix
                        iframely/static/js/iframely.js on lines 13..54

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 249.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                            var windowMessaging = function(){
                        
                                return {
                                    postMessage : function(message, target_url, target) {
                        
                        
                        Severity: Major
                        Found in iframely/static/js/iframely.js and 1 other location - About 1 day to fix
                        iframely/static/js/iframely-for-iframe.js on lines 11..52

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 249.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language