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, {
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)
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
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 = {
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"
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() {
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) {
- Read upRead up
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);
};
- Read upRead up
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?
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_);
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);
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, {
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();
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
- Read upRead up
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;
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();
Class Site
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Site < ::Thor
include Spontaneous::Cli::TaskUtils
include ::Simultaneous::Task
namespace :site
Class PrototypeSet
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class PrototypeSet
include Enumerable
attr_reader :store, :local_order
Class Site
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Spontaneous::Site
module Publishing
extend Spontaneous::Concern
def background_mode
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,