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
Class Index
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Index
attr_reader :name, :search_types, :site
def initialize(site, name, &definition)
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({
- 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 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) {
- 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 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) {
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'
Class BoxContents
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class BoxContents < Spontaneous::Output::RenderableArray
attr_reader :box, :schema_id
def initialize(box)
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, {
- 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 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 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();