newscoop/JS-Scoopwriter

View on GitHub

Showing 98 of 221 total issues

Function updateRole has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        Author.prototype.updateRole = function (params) {
            var headersParam,
                linkHeader,
                promise,
                url;
Severity: Minor
Found in app/scripts/services/Author.js - About 1 hr to fix

    Function circularBufferFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        function circularBufferFactory() {
            /**
                * Creates a new circular buffer instance.
                *
                * @method create
    Severity: Minor
    Found in app/scripts/services/circular-buffer-factory.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 create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            Snippet.create = function (name, templateId, fields) {
                var deferredPost = $q.defer(),
                    requestData;
    
                requestData = {
    Severity: Minor
    Found in app/scripts/services/Snippet.js - About 1 hr to fix

      Function circularBufferFactory has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function circularBufferFactory() {
              /**
                  * Creates a new circular buffer instance.
                  *
                  * @method create
      Severity: Minor
      Found in app/scripts/services/circular-buffer-factory.js - About 1 hr to fix

        Function getAllByPage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                self.getAllByPage = function (page) {
                    var deferredGet = $q.defer(),
                        url;
        
                    var totalPerPage = itemsPerPage * latestPage;
        Severity: Minor
        Found in app/scripts/services/editorial-comments.js - About 1 hr to fix

          Function query has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  NcImage.query = function (page, itemsPerPage, searchFilter) {
                      var deferredGet = $q.defer(),
                          requestOptions,
                          results = [],
                          url;
          Severity: Minor
          Found in app/scripts/services/NcImage.js - About 1 hr to fix

            Function confirmUnassignArticlesList has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        self.confirmUnassignArticlesList = function (articlesList) {
                            var modal,
                                title,
                                text;
            
            
            Severity: Minor
            Found in app/scripts/controllers/pane-articles-lists.js - About 1 hr to fix

              Function confirmRemoveAuthor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      $scope.confirmRemoveAuthor = function (author) {
                          var modal,
                              title,
                              text;
              
              
              Severity: Minor
              Found in app/scripts/controllers/pane-authors.js - About 1 hr to fix

                Function confirmUnassignRelatedArticle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        self.confirmUnassignRelatedArticle = function (relatedArticle) {
                            var modal,
                                title,
                                text;
                
                
                Severity: Minor
                Found in app/scripts/controllers/pane-related-articles.js - About 1 hr to fix

                  Function create has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          this.create = function (opt) {
                              if (!('size' in opt)) {
                                  throw new Error(
                                          'a circular buffer needs an integer size option');
                              }
                  Severity: Minor
                  Found in app/scripts/services/circular-buffer-factory.js - About 1 hr to fix

                    Function updateButtonsMode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                function updateButtonsMode() {
                                    var editables,
                                        blocks,
                                        selection = $window.getSelection(),
                                        testRange,
                    Severity: Minor
                    Found in app/scripts/directives/sf-aloha-format-link.js - About 1 hr to fix

                      Function addToArticle has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              Topic.addToArticle = function (articleId, language, topics) {
                                  var deferred = $q.defer(),
                                      linkHeader = [];
                      
                                  if (topics.length < 1) {
                      Severity: Minor
                      Found in app/scripts/services/Topic.js - About 1 hr to fix

                        Function applyPlacement has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          Tooltip.prototype.applyPlacement = function(offset, placement) {
                            var replace
                            var $tip   = this.tip()
                            var width  = $tip[0].offsetWidth
                            var height = $tip[0].offsetHeight
                        Severity: Minor
                        Found in app/scripts/bootstrap.min.js - About 1 hr to fix

                          Function ModalCtrl has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function ModalCtrl($modalInstance, $sce, info, $rootScope) {
                                  var self = this,
                                      url;
                          
                                  switch(info.action) {
                          Severity: Minor
                          Found in app/scripts/controllers/slideshowsEditor.js - About 1 hr to fix

                            Function confirmDeleteComments has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    $scope.confirmDeleteComments = function (commentId) {
                                        var commentIdGiven = (typeof commentId !== 'undefined'),
                                            modal,
                                            title,
                                            text;
                            Severity: Minor
                            Found in app/scripts/controllers/comments.js - About 1 hr to fix

                              Function show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                Collapse.prototype.show = function () {
                                  if (this.transitioning || this.$element.hasClass('in')) return
                              
                                  var startEvent = $.Event('show.bs.collapse')
                                  this.$element.trigger(startEvent)
                              Severity: Minor
                              Found in app/scripts/bootstrap.min.js - About 1 hr to fix

                                Function authorRoleChanged has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        self.authorRoleChanged = function (newRole, oldRole, author) {
                                            author.updatingRole = true;
                                
                                            author.updateRole({
                                                number: article.articleId,
                                Severity: Minor
                                Found in app/scripts/controllers/pane-authors.js - About 1 hr to fix

                                  Function confirmHideComments has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          $scope.confirmHideComments = function (commentId) {
                                              var commentIdGiven = (typeof commentId !== 'undefined'),
                                                  modal,
                                                  title,
                                                  text;
                                  Severity: Minor
                                  Found in app/scripts/controllers/comments.js - About 1 hr to fix

                                    Function ModalCtrl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function ModalCtrl($modalInstance, $sce, info, $rootScope) {
                                            var self = this,
                                                url;
                                    
                                            switch(info.action) {
                                    Severity: Minor
                                    Found in app/scripts/controllers/pane-articles-lists.js - About 1 hr to fix

                                      Function setOrderOfRelatedArticles has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              function (relatedArticle, index) {
                                                  var self = this,
                                                      defered = $q.defer(),
                                                      linkHeader = [];
                                      
                                      
                                      Severity: Minor
                                      Found in app/scripts/services/Article.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language