newscoop/JS-Scoopwriter

View on GitHub

Showing 98 of 221 total issues

File bootstrap.min.js has 1185 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.0.2 by @fat and @mdo
 * Copyright 2013 Twitter, Inc.
 * Licensed under http://www.apache.org/licenses/LICENSE-2.0
 *
Severity: Major
Found in app/scripts/bootstrap.min.js - About 3 days to fix

    Function comments has 308 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function comments(
            articleService, $http, $q, $resource, transform, pageTracker,
            $log, nestedSort
        ) {
            /* max number of comments per page, decrease it in order to
    Severity: Major
    Found in app/scripts/services/comments.js - About 1 day to fix

      Function images has 244 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function images(
              pageTracker, $log, articleService,
              getFileReader, formDataFactory, imageFactory, NcImage,
              $rootScope, $q
          ) {
      Severity: Major
      Found in app/scripts/services/images.js - About 1 day to fix

        File Article.js has 516 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        /**
        * A factory which creates article model.
        *
        Severity: Major
        Found in app/scripts/services/Article.js - About 1 day to fix

          Function comments has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              function comments(
                  articleService, $http, $q, $resource, transform, pageTracker,
                  $log, nestedSort
              ) {
                  /* max number of comments per page, decrease it in order to
          Severity: Minor
          Found in app/scripts/services/comments.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 postLink has 200 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      link: function postLink(scope, element, attrs, controllers) {
                          var ctrl = controllers[0],
                              imgConfig = {},
                              parentCtrl = controllers[1],
                              $element = $(element),
          Severity: Major
          Found in app/scripts/directives/dropped-image.js - About 1 day to fix

            Function directiveConstructor has 175 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function directiveConstructor($rootScope, $modal, $window, toaster) {
                    var template = [
                        '<div>',
                        '  <button class="btn btn-default btn-sm" title="Add Link">',
                        '      <i class="fa fa-link"></i>',
            Severity: Major
            Found in app/scripts/directives/sf-aloha-format-link.js - About 7 hrs to fix

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

                  function initStubbedBackend() {
                      ng.module('authoringEnvironmentApp')
                          .config(['$provide', function($provide) {
                              $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
                          }])
              Severity: Major
              Found in app/scripts/httpBackendStub.js - About 6 hrs to fix

                Function postLink has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function postLink(scope, element, attrs) {
                            var children,
                                cmdLinkEnabled,
                                cmdLinkSupported,
                                cmdUnlinkEnabled,
                Severity: Major
                Found in app/scripts/directives/sf-aloha-format-link.js - About 6 hrs to fix

                  Function images has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function images(
                          pageTracker, $log, articleService,
                          getFileReader, formDataFactory, imageFactory, NcImage,
                          $rootScope, $q
                      ) {
                  Severity: Minor
                  Found in app/scripts/services/images.js - About 5 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 linkFunction has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function linkFunction(scope, element, attrs) {
                          var newIdx = -1,  // dragged element's (potential) new position
                              $emptySlot = null,  // DOM marker for the new position
                              $rootElement,  // root DOM element the directive is applied to
                              draggedElementIdx = -1;  // index of the element being dragged
                  Severity: Major
                  Found in app/scripts/directives/drag-sort.js - About 4 hrs to fix

                    Function decorate has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function decorate(comment) {
                                /**
                                * @class comment
                                */
                    
                    
                    Severity: Major
                    Found in app/scripts/services/comments.js - About 4 hrs to fix

                      Function decorate has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function decorate(comment) {
                                  /**
                                  * @class comment
                                  */
                      
                      
                      Severity: Major
                      Found in app/scripts/services/editorial-comments.js - About 4 hrs to fix

                        File comments.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        'use strict';
                        
                        /**
                        * AngularJS Service for managing article comments.
                        *
                        Severity: Minor
                        Found in app/scripts/services/comments.js - About 3 hrs to fix

                          Function exports has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function(config) {
                            config.set({
                              // base path, that will be used to resolve files and exclude
                              basePath: '',
                          
                          
                          Severity: Major
                          Found in karma.conf.js - About 3 hrs to fix

                            File editorial-comments.js has 314 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            'use strict';
                            
                            /**
                            * AngularJS Service for managing article comments.
                            *
                            Severity: Minor
                            Found in app/scripts/services/editorial-comments.js - About 3 hrs to fix

                              Function postLink has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          link: function postLink(scope, element, attrs) {
                                              var counter,
                                                  $element = $(element);
                              
                                              // when dragging over a child element, a dragleave event is
                              Severity: Major
                              Found in app/scripts/directives/sf-droppable.js - About 3 hrs to fix

                                File comments.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                'use strict';
                                
                                /**
                                * AngularJS controller for managing article comments (as a group,
                                * not individual comments).
                                Severity: Minor
                                Found in app/scripts/controllers/comments.js - About 3 hrs to fix

                                  Function setEventHandlers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          function setEventHandlers($element) {
                                              $element.attr('draggable', true);
                                  
                                              $element.on('dragstart', function (e) {
                                                  var dragData;
                                  Severity: Major
                                  Found in app/scripts/directives/drag-sort.js - About 2 hrs to fix

                                    Function postLink has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                link: function postLink(scope, element, attrs) {
                                                    var checkAvailable,
                                                        clickFunction,
                                                        clickEvent,
                                                        checkEvent;
                                    Severity: Major
                                    Found in app/scripts/directives/sf-aloha-command-button.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language