SpontaneousCMS/spontaneous

View on GitHub

Showing 342 of 342 total issues

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 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

              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

              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

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

                                  this.panel.velocity({'height': '+=14'}, {duration: 200, complete: function() {
                                      var view = $('h3', this.panel), edit = $('.edit', this.panel), spacer = $('.path-spacer', this.panel);
                                      spacer.add(view).hide();
                                      edit.hide().empty();
                                      var path = [''], parts = this.page.get('path').split('/'), slug = parts.pop();
                      Severity: Major
                      Found in application/js/views/page_view.js - About 2 hrs to fix

                        Method run! has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def self.run!(site, options={})
                              host = options["host"] || Spontaneous::Site.config.host || "0.0.0.0"
                              port = options["port"] || Spontaneous::Site.config.port || 2012
                              adapter = options["adapter"] || Spontaneous::Site.config.adapter
                        
                        
                        Severity: Minor
                        Found in lib/spontaneous/server.rb - 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 Image has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Spontaneous.Image = (function($, S) {
                            var dom = Spontaneous.Dom;
                            var Image = new JS.Class({
                                initialize: function(field) {
                                    this.field = field;
                        Severity: Major
                        Found in application/js/image.js - About 2 hrs to fix

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

                                  edit: function() {
                                      var self = this;
                                      var wrap = dom.div('.file-field', {'style':'position:relative;'});
                                      var value = this.value();
                                      var input = this.input();
                          Severity: Major
                          Found in application/js/field/file.js - About 2 hrs to fix

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

                                class Site < ::Thor
                                  include Spontaneous::Cli::TaskUtils
                                  include ::Simultaneous::Task
                                  namespace :site
                            
                            
                            Severity: Minor
                            Found in lib/spontaneous/cli/site.rb - About 2 hrs to fix

                              Class PrototypeSet has 24 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                class PrototypeSet
                                  include Enumerable
                              
                                  attr_reader :store, :local_order
                              
                              
                              Severity: Minor
                              Found in lib/spontaneous/collections/prototype_set.rb - About 2 hrs to fix

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

                                class Spontaneous::Site
                                  module Publishing
                                    extend Spontaneous::Concern
                                
                                    def background_mode
                                Severity: Minor
                                Found in lib/spontaneous/site/publishing.rb - About 2 hrs to fix

                                  Function Editing has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Spontaneous.Editing = (function($, S) {
                                      var dom = S.Dom, Page = S.Page;
                                  
                                      var Editing = new JS.Singleton({
                                          include: Spontaneous.Properties,
                                  Severity: Major
                                  Found in application/js/editing.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language