fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

        controller: function($scope, $element, $attrs) {

            $scope.harvestingFreqList = HarvestingFrequencyService.values;
            $scope.sourceTypeList = SourceTypeService.sourceTypeList;
            $scope.sourceTypeListWEndpoint = {};
Severity: Major
Found in app/js/directives/add-connection-modal.js - About 1 day to fix

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

            controller: function($scope) {
                var timelineIntervals = [];
                $rootScope.root.timelineNewTweets = [];
                $rootScope.root.haveNewerTweets = false;
                $rootScope.root.doneGettingFeed = false;
    Severity: Major
    Found in app/js/directives/signin-twitter.js - About 1 day to fix

      Function WallCtrl has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
      Open

      function WallCtrl($scope, $rootScope, $window, $timeout, AppsService, HelloService, SearchService) {
      
          var vm = this;
          var term = '';
          var isEditing = -1;
      Severity: Minor
      Found in app/js/controllers/wall.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 token has 213 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Lexer.prototype.token = function(src, top) {
        var src = src.replace(/^ +$/gm, '')
          , next
          , loose
          , cap
      Severity: Major
      Found in app/js/components/marked.js - About 1 day to fix

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

                 controller: function() {
                     $rootScope.root.tweet= "";
                     $rootScope.root.tweetType = 1;
                     $rootScope.root.tweetLength = 140;
                     $rootScope.root.userLocation = {};
        Severity: Major
        Found in app/js/directives/tweet-feature-drt.js - About 1 day to fix

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

                  link: function link(scope, element, attrs, ngModelController) {
          
                    var directiveConfig = {};
          
                    if (attrs.datetimepickerConfig) {
          Severity: Major
          Found in app/js/components/datetimepicker.js - About 1 day to fix

            Function processPluginTests has 205 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function processPluginTests(pluginTest, plugin, count, cb) {
            
                var testUrlsSet, reachTestObjectFound = false;;
            
                log('===========================================');
            Severity: Major
            Found in iframely/modules/tests-ui/tester.js - About 1 day to fix

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

                  compile: function(tElement, tAttrs) {
              
                    //Multiple or Single depending if multiple attribute presence
                    if (angular.isDefined(tAttrs.multiple))
                      tElement.append("<ui-select-multiple/>").removeAttr('multiple');
              Severity: Major
              Found in app/js/components/select.js - About 7 hrs to fix

                Function login has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                    login: function() {
                
                        // Create an object which inherits its parent as the prototype and constructs a new event chain.
                        var _this = this;
                        var utils = _this.utils;
                Severity: Minor
                Found in app/js/components/hello.all.js - About 7 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 ChartJsFactory has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function ChartJsFactory (ChartJs) {
                      function sum (carry, val) {
                        return carry + val;
                      }
                
                
                Severity: Major
                Found in app/js/components/angular-chart.js - About 7 hrs to fix

                  Function AdvancedSearchCtrl has a Cognitive Complexity of 48 (exceeds 5 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: Minor
                  Found in app/js/controllers/advanced-search.js - About 7 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 Promise has a Cognitive Complexity of 45 (exceeds 5 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: Minor
                  Found in app/js/components/hello.all.js - About 6 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 44 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getLink: function(url, options) {
                          url = URL.parse(url,true);
                  
                          var query = url.query;
                  
                  
                  Severity: Minor
                  Found in iframely/plugins/domains/google.com/maps.google.com.js - About 6 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

                  File tester.js has 444 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  GLOBAL.CONFIG = require('../../config');
                  
                  if (!CONFIG.tests) {
                      console.error('Tests not started: CONFIG.tests not configured.');
                      process.abort();
                  Severity: Minor
                  Found in iframely/modules/tests-ui/tester.js - About 6 hrs to fix

                    Function getstatfollower has 164 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                         $scope.getstatfollower = function () {
                            viewloading();
                    
                            $http.jsonp(AppSettings.apiUrl+"user.json?callback=JSON_CALLBACK", {params : { screen_name :$scope.username, followers : 10000, following : 10000, minified: true } })
                                .success(function(data, status, headers, config) {
                    Severity: Major
                    Found in app/js/controllers/analyze.js - About 6 hrs to fix

                      Function responseHandler has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                      Open

                          responseHandler: function(window, parent) {
                      
                              var _this = this;
                              var p;
                              var location = window.location;
                      Severity: Minor
                      Found in app/js/components/hello.all.js - About 6 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

                      File html-utils.js has 421 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      (function() {
                      
                          var $ = require('cheerio');
                          var _ = require('underscore');
                      
                      
                      Severity: Minor
                      Found in iframely/lib/html-utils.js - About 6 hrs to fix

                        Function xhr has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                        Open

                            xhr: function(method, url, headers, data, callback) {
                        
                                var r = new XMLHttpRequest();
                                var error = this.error;
                        
                        
                        Severity: Minor
                        Found in app/js/components/hello.all.js - About 6 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 append has a Cognitive Complexity of 40 (exceeds 5 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 6 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 postTweet has 150 lines of code (exceeds 25 allowed). 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 - About 6 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language