Showing 261 of 342 total issues
Class User
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class User < Sequel::Model(:spontaneous_users)
extend Forwardable
plugin :timestamps
File box_view.js
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
// console.log('Loading BoxView...')
Spontaneous.Views.BoxView = (function($, S) {
'use strict';
var dom = S.Dom;
File schema.rb
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Spontaneous
module Schema
autoload :UID, 'spontaneous/schema/uid'
autoload :UIDMap, 'spontaneous/schema/uid_map'
autoload :SchemaModification, 'spontaneous/schema/schema_modification'
Method schema_validate
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def schema_validate(schema)
if schema_id.nil?
schema.missing_id!(:type, self)
else
# only need to check internal consistency if class already existed
- 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 Properties
has 102 lines of code (exceeds 25 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 = {}; }
Function Popover
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Popover = (function($, S) {
var dom = S.Dom;
var __popover_id = 0;
var Popover = new JS.Class({
initialize: function(view) {
Function Types
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Types = (function($, S) {
var ajax = S.Ajax
, user = S.User
, type_map = {};
Function Dom
has a Cognitive Complexity of 27 (exceeds 5 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);
- 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 ShardedUpload
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.ShardedUpload = (function($, S) {
var dom = S.Dom;
var upload_id = (new Date()).valueOf();
var Shard = new JS.Class({
initialize: function(uploader, index, blob) {
- 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 a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Image = (function($, S) {
var dom = Spontaneous.Dom;
var Image = new JS.Class({
initialize: function(field) {
this.field = field;
- 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 SchemaModification
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class SchemaModification
def initialize(missing_from_map, missing_from_schema, grouped=false)
@missing_from_map = missing_from_map
Function Preview
has 91 lines of code (exceeds 25 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);
};
File revision.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Spontaneous::Publishing
def self.create_content_table(db, source_table, dest_table_name)
# sqlite doesn't like it if you create a table with no columns
# so hard-code the id column (but don't make it a pk because the
# unique constraint isn't useful at this stage)
Function PageBrowser
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.PageBrowser = (function($, S) {
var dom = S.Dom
, flattenPageList = function(pageList) {
var pages = []
, comparator = function(a, b) {
- 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 PageController
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class PageController < Sinatra::Base
class << self
# We wrap Sinatra's route methods in order to do two things:
# 1. To provide a path of '*' when none is given and
# 2. To register the presence of a handler for each method in order to
Class Image
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Image < File
autoload :Size, 'spontaneous/field/image/size'
include Spontaneous::Media::Image::Renderable
Class ScopingMapper
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class ScopingMapper
extend Forwardable
attr_reader :schema, :table
Function Upload
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Upload = (function($, S) {
var upload_id = (new Date()).valueOf();
var Upload = new JS.Class({
initialize: function(manager, target, file, insert_position) {
this.manager = manager;
Function Box
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Box = (function($, S) {
var dom = S.Dom;
var Box = new JS.Class(Spontaneous.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 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
preview: function() {
Spontaneous.UploadManager.register(this);
var self = this
, value = this.currentValue()
, src = value.src