SpontaneousCMS/spontaneous

View on GitHub

Showing 261 of 342 total issues

File page_view.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// console.log('Loading Page...')

Spontaneous.Views.PageView = (function($, S, document) {
    var dom = S.Dom, user = S.User, ajax = S.Ajax, Types = S.Types;

Severity: Minor
Found in application/js/views/page_view.js - About 5 hrs to fix

    File publish.js has 410 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // console.log('Loading Publishing...')
    
    Spontaneous.Publishing = (function($, S) {
        var dom = S.Dom, Dialogue = Spontaneous.Dialogue, User = S.User;
    
    
    Severity: Minor
    Found in application/js/publish.js - About 5 hrs to fix

      Class Dataset has 43 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class Dataset
            include Enumerable
      
            def initialize(dataset, schema, identity_map)
              @dataset, @schema, @identity_map = dataset, schema, identity_map
      Severity: Minor
      Found in lib/spontaneous/data_mapper/dataset.rb - About 5 hrs to fix

        Class Revision has 43 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Revision
            class InvalidRevision < Spontaneous::Error; end
        
            class Generator
              attr_reader :modified_pages
        Severity: Minor
        Found in lib/spontaneous/publishing/revision.rb - About 5 hrs to fix

          Function PieceView has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

          Spontaneous.Views.PieceView = (function($, S) {
              var dom = S.Dom, user = S.User;
              var debug = 0;
          
              var ConfirmDeletePopup = new JS.Class(Spontaneous.PopoverView, {
          Severity: Minor
          Found in application/js/views/piece_view.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 Properties has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

          Spontaneous.Properties = (function($, S) {
              var Properties = new JS.Module({
                  _props_debug: false,
                  _props_properties: function() {
                      if (!this._props_property_store) { this._props_property_store = {}; }
          Severity: Minor
          Found in application/js/properties.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 Views has 142 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Spontaneous.Views = (function($, S) {
              var dom = S.Dom;
              var View = new JS.Class({
                  include: Spontaneous.Properties,
                  initialize: function(content) {
          Severity: Major
          Found in application/js/views.js - About 5 hrs to fix

            Function PageBrowser has 141 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Spontaneous.PageBrowser = (function($, S) {
                var dom = S.Dom
            , flattenPageList = function(pageList) {
                    var pages = []
                    , comparator = function(a, b) {
            Severity: Major
            Found in application/js/page_browser.js - About 5 hrs to fix

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

              Spontaneous.Field.File = (function($, S) {
                  var dom = S.Dom;
                  var FileField = new JS.Class(Spontaneous.Field.String, {
                      selected_files: false,
              
              
              Severity: Minor
              Found in application/js/field/file.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 Location has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              Spontaneous.Location = (function($, S) {
                  var ajax = S.Ajax;
              
                  var State = new JS.Class({
                      initialize: function(path) {
              Severity: Minor
              Found in application/js/location.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 Box has 130 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Spontaneous.Box = (function($, S) {
                  var dom = S.Dom;
              
                  var Box = new JS.Class(Spontaneous.Content, {
              
              
              Severity: Major
              Found in application/js/box.js - About 5 hrs to fix

                Function Ajax has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                Spontaneous.Ajax = (function($, S) {
                    'use strict';
                
                    $.ajaxSetup({
                        'async': true,
                Severity: Minor
                Found in application/js/ajax.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

                Method sync_to_revision has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                    def sync_to_revision(revision, origin=false)
                      # 'publish' is a lock to make sure the duplication doesn't cross
                      # page boundaries unless that's necessary (such as in the case
                      # of a page addition)
                      publish = origin || !page?
                Severity: Minor
                Found in lib/spontaneous/model/core/publishing.rb - 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

                File box.rb has 373 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module Spontaneous
                  class Box
                    include Enumerable
                
                    include Spontaneous::Model::Core::SchemaHierarchy
                Severity: Minor
                Found in lib/spontaneous/box.rb - About 4 hrs to fix

                  File base.rb has 370 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module Spontaneous
                    module Field
                      class Base
                        module ClassMethods
                          def has_editor(js_class = ui_class)
                  Severity: Minor
                  Found in lib/spontaneous/field/base.rb - About 4 hrs to fix

                    Class Fog has 37 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class Fog < Backend
                        def initialize(config)
                          @config = config
                        end
                    
                    
                    Severity: Minor
                    Found in lib/spontaneous/output/store/fog.rb - About 4 hrs to fix

                      Function ContentArea has 114 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Spontaneous.ContentArea = (function($, S) {
                          var dom = S.Dom;
                          var ContentArea = new JS.Singleton({
                              include: Spontaneous.Properties,
                      
                      
                      Severity: Major
                      Found in application/js/content_area.js - About 4 hrs to fix

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

                                edit: function() {
                                    var wrap = dom.div(),
                                    drop_wrap = dom.div({'style':'position:relative;'}),
                                        value = this.currentEditValue(),
                                        src = value.src,
                        Severity: Major
                        Found in application/js/field/image.js - About 4 hrs to fix

                          File image.js has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          // console.log('Loading ImageField...')
                          Spontaneous.Field.Image = (function($, S) {
                              'use strict';
                              var dom = S.Dom;
                              var ImageFieldConflictView = new JS.Class(S.Field.String.ConflictView, {
                          Severity: Minor
                          Found in application/js/field/image.js - About 4 hrs to fix

                            Class BoxPrototype has 34 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                              class BoxPrototype
                            
                                attr_reader :name, :options, :owner
                            
                                def initialize(owner, name, options, blocks = [], &block)
                            Severity: Minor
                            Found in lib/spontaneous/prototypes/box_prototype.rb - About 4 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language