Showing 261 of 342 total issues
Method parse_response
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def parse_response(response)
case
when response.is_a?(site.model)
@page = response
when response.respond_to?(:to_str)
- 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 ContentArea
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.ContentArea = (function($, S) {
var dom = S.Dom;
var ContentArea = new JS.Singleton({
include: Spontaneous.Properties,
- 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 add_allowed_types_bar
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_allowed_types_bar: function(position, insert_at) {
var allowed = this.box.allowed_types();
if (allowed.length === 0) { return ''; }
var _box = this
, allowed_bar = dom.div('.slot-addable')
File file.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
// console.log('Loading FileField...')
Spontaneous.Field.File = (function($, S) {
var dom = S.Dom;
var FileField = new JS.Class(Spontaneous.Field.String, {
selected_files: false,
Function targets_loaded
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
targets_loaded: function(results) {
var outer = this._outer, wrap, self = this, targets = self.sort_targets(results.targets);
window.setTimeout(function() { self.spinner.stop(); }, 300);
if (targets.length === 0) {
var $msg = dom.div('.alias-dialogue-empty-targets').text('No targets available...');
Function FieldPreview
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.FieldPreview = (function($, S) {
var dom = S.Dom;
var FieldPreview = new JS.Class({
initialize: function(view, wrap_id, listView) {
Method ask_user_details
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def ask_user_details(defaults = {}, users)
attrs = {}
level = nil
width = 14
valid_login = /^[a-z0-9_]{3,}$/
- 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 panel
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
panel: function() {
var self = this;
if (self._panel) {
return self._panel;
}
Function body
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
body: function() {
var self = this
, editing = dom.div('#add-alias-dialogue')
, outer = dom.div('.typelist')
, paging = dom.div('.paging')
Function preview
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
preview: function() {
Spontaneous.UploadManager.register(this);
var self = this
, value = this.currentValue()
, filename = this.currentFilename();
Function AddHomeDialogue
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.AddHomeDialogue = (function($, S, window) {
var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
var AddHomeDialogue = new JS.Class(Dialogue, {
initialize: function(types) {
File modifications.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Spontaneous::Model::Core
# Modifications is responsible for tracking changes made to Content items
module Modifications
extend Spontaneous::Concern
Function panel
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
panel: function() {
if (!this._panel) {
var box = this.box;
var panel = dom.div('.slot-content');
panel.addClass('empty');
Function expand_selection
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
expand_selection: function(state) {
state = this.fix_selection_whitespace(state);
var selected = state.selection, m, start = state.start, end = state.end,
_pre_ = this.pre.replace(/\*/g, '\\*'), _post_ = this.post.replace(/\*/g, '\\*');
Method targets
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def targets(owner = nil, box = nil, options = {})
targets = []
classes = []
proc_args = [owner, box].compact
@alias_classes.each do |source|
- 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 load_classes_with_requirements
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def load_classes_with_requirements(klasses)
klasses.uniq!
while klasses.size > 0
# Note size to make sure things are loading
- 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 targets
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def targets(owner = nil, box = nil, options = {})
targets = []
classes = []
proc_args = [owner, box].compact
@alias_classes.each do |source|
Function createPanel
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
createPanel: function() {
var w = dom.div('.change-set')
, inner = dom.div('.inner')
, page_list = dom.div('.pages')
, add = dom.div('.add').append(dom.span().text(''))
Function Popover
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Popover = (function($, S) {
var dom = S.Dom;
var __popover_id = 0;
var Popover = new JS.Class({
initialize: function(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 Upload
has a Cognitive Complexity of 14 (exceeds 5 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;
- 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"