SpontaneousCMS/spontaneous

View on GitHub

Showing 261 of 342 total issues

Class FieldPrototype has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

  class FieldPrototype
    attr_reader :owner, :name, :options

    def initialize(owner, name, type, options={}, blocks = [], &block)
      @owner = owner
Severity: Minor
Found in lib/spontaneous/prototypes/field_prototype.rb - About 3 hrs to fix

    Class Index has 28 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Index
    
        attr_reader :name, :search_types, :site
    
        def initialize(site, name, &definition)
    Severity: Minor
    Found in lib/spontaneous/search/index.rb - About 3 hrs to fix

      Function Dialogue has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      Spontaneous.Dialogue = (function($, S) {
          var dom = S.Dom;
      
      
          var Button = new JS.Class({
      Severity: Minor
      Found in application/js/dialogue.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 UserAdmin has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      Spontaneous.MetaView.UserAdmin = (function($, S){
          var dom = S.Dom, ajax = S.Ajax;
      
          var Level = new JS.Class({
              initialize: function(attributes) {
      Severity: Minor
      Found in application/js/meta_view/user_admin.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 ConflictedFieldDialogue has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Spontaneous.ConflictedFieldDialogue = (function($, S) {
          var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
      
          var ConflictedFieldDialogue = new JS.Class(Dialogue, {
              initialize: function(parent_view, conflicted_fields) {
      Severity: Major
      Found in application/js/conflicted_field_dialogue.js - About 3 hrs to fix

        File content_model.rb has 299 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'spontaneous/data_mapper/content_model/column_accessors'
        require 'spontaneous/data_mapper/content_model/serialization'
        require 'spontaneous/data_mapper/content_model/timestamps'
        require 'spontaneous/data_mapper/content_model/instance_hooks'
        require 'spontaneous/data_mapper/content_model/associations'
        Severity: Minor
        Found in lib/spontaneous/data_mapper/content_model.rb - About 3 hrs to fix

          Class BoxContents has 27 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class BoxContents < Spontaneous::Output::RenderableArray
          
                attr_reader :box, :schema_id
          
                def initialize(box)
          Severity: Minor
          Found in lib/spontaneous/collections/box_contents.rb - About 3 hrs to fix

            Function BoxContainer has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

            Spontaneous.BoxContainer = (function($, S) {
                var dom = S.Dom;
            
                var BoxContainer = new JS.Class(S.Views.View, {
            
            
            Severity: Minor
            Found in application/js/box_container.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 BoxContainer has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Spontaneous.BoxContainer = (function($, S) {
                var dom = S.Dom;
            
                var BoxContainer = new JS.Class(S.Views.View, {
            
            
            Severity: Major
            Found in application/js/box_container.js - About 3 hrs to fix

              Function change_list_loaded has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      change_list_loaded: function(outstanding) {
                          var change_list = outstanding.changes
                          , w = this.wrapper
                          , self = this
                          , changed_wrap = dom.div('#changes.change-list').css('opacity', 0)
              Severity: Major
              Found in application/js/publish.js - About 3 hrs to fix

                Method smarten has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def smarten(string, options=[2])
                      do_quotes = do_backticks = do_dashes = do_ellipses = do_stupify = nil
                      convert_quotes = false
                
                      if options.include? 0
                Severity: Major
                Found in lib/spontaneous/utils/smart_quotes.rb - About 3 hrs to fix

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

                  // console.log('Loading Progress...');
                  
                  Spontaneous.Progress = (function($, S) {
                      var Progress = function(parent, size, options) {
                          var defaults = {
                  Severity: Minor
                  Found in application/js/progress.js - About 3 hrs to fix

                    Class Site has 26 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class Site < Spontaneous::Facet
                        require "spontaneous/site/assets"
                        require "spontaneous/site/features"
                        require "spontaneous/site/helpers"
                        require "spontaneous/site/hooks"
                    Severity: Minor
                    Found in lib/spontaneous/site.rb - About 3 hrs to fix

                      Function open_url_editor has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              open_url_editor: function() {
                                  this.unavailable = false;
                                  this.url_editor_open = true;
                                  Spontaneous.Ajax.get(['/page', this.page.id(), 'slug/unavailable'].join('/'), this.unavailable_loaded.bind(this));
                                  this.panel.velocity({'height': '+=14'}, {duration: 200, complete: function() {
                      Severity: Major
                      Found in application/js/views/page_view.js - About 2 hrs to fix

                        Function Preview has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Spontaneous.Preview = (function($, S, $window) {
                            var dom = S.Dom, goto_id = 0, Ajax = S.Ajax;
                            var click_param = function() {
                                return '?__click='+(++goto_id);
                            };
                        Severity: Minor
                        Found in application/js/preview.js - About 2 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 Views has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Spontaneous.Views = (function($, S) {
                            var dom = S.Dom;
                            var View = new JS.Class({
                                include: Spontaneous.Properties,
                                initialize: function(content) {
                        Severity: Minor
                        Found in application/js/views.js - About 2 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

                        Class File has 25 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class File < Base
                            has_editor
                        
                            def blank?
                              values[:path].blank?
                        Severity: Minor
                        Found in lib/spontaneous/field/file.rb - About 2 hrs to fix

                          Function view has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  view: function() {
                                      var _save_ = this.save.bind(this);
                                      var _cancel_ = this.cancel.bind(this);
                                      var get_toolbar = function(class_name) {
                                          var save = dom.a('.button.save').html(dom.cmd_key_label('Save', 's')).click(_save_);
                          Severity: Major
                          Found in application/js/edit_panel.js - About 2 hrs to fix

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

                            Spontaneous.Dom = (function($, S) {
                                var tags = 'div p iframe a span strong i img select option label ul li dl dt dd table tr td h1 h2 h3 h4 header input button form textarea optgroup'.split(' ');
                                var Dom = {
                                    body: function() {
                                        return $(document.body);
                            Severity: Major
                            Found in application/js/dom.js - About 2 hrs to fix

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

                              Spontaneous.Views.PagePieceView = (function($, S) {
                                  'use strict';
                                  var dom = S.Dom;
                              
                                  var PagePieceView = new JS.Class(Spontaneous.Views.PieceView, {
                              Severity: Major
                              Found in application/js/views/page_piece_view.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language