Showing 261 of 342 total issues
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,
Function State
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.State = (function($, S) {
var ajax = S.Ajax;
var ContentState = new JS.Class({
initialize: function(content) {
Function Types
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Types = (function($, S) {
var ajax = S.Ajax
, user = S.User
, type_map = {};
- 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
Method at_depth
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def at_depth(depth, opts = {})
return root_at_depth(depth) if is_public_root? || is_private_root?
parent_depth = [0, depth - 1].max
parent = if (parent_depth == 0)
public_root
- 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
Method to_html
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def to_html(opts={})
default_attr = { src: src, alt: "" }
attrs = Spontaneous::Field::Image.default_attributes.merge(opts)
if template_params && template_params.length > 0 && template_params[0].is_a?(Hash)
- 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
Method safe_load
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def safe_load(file, mtime=nil)
reload = mtime && mtime > mtimes[file]
logger.debug "Reloading #{relativize_path(file)}" if reload
- 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 expand_selection
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
expand_selection: function(state) {
var selected = (state.selection || ''), m, s, l, start = state.start, end = state.end, br = /\r?\n/, below = false;
// detect & deal with the cursor being on the line below
// (the one with the -'s or ='s)
// TODO: deal with the case where the cursor is at the start of the =- line
Class Style
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Style
attr_reader :owner, :prototype
def initialize(owner, prototype = nil)
@owner, @prototype = owner, prototype
Class Generator
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Generator
attr_reader :modified_pages
# Both revision & source_revision should be instances of Revision
def initialize(revision)
Class AllowedType
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class AllowedType
prepend Spontaneous::Model::Page::Singleton::AllowedTypeMethods
attr_accessor :allow_subclasses
Function Select
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Field.Select = (function($, S) {
'use strict';
var dom = S.Dom
, ajax = S.Ajax;
File loader.rb
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pathname'
module Spontaneous
class Loader
attr_reader :use_reloader, :load_paths
Function PopoverView
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.PopoverView = (function($, S) {
var dom = S.Dom;
var PopoverView = new JS.Class({
initialize: function() {
// should be over-ridden by subclasses