Showing 38 of 74 total issues
Function SlicesController
has 466 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: function SlicesController() {
// private vars
var settings,
busy = true;
AssetLibraryView
has 58 functions (exceeds 20 allowed). Consider refactoring. Open
slices.AssetLibraryView = Backbone.View.extend({
DRAG_THRESHOLD: 15,
DRAWER_HEIGHT: 250,
File slices.js
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Slices.js
// (c) 2011 With Associates
// http://slices.withassociates.com/
var slices = {
File asset_library_view.js
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
// The asset library is dedicated to browsing, searching and managing of
// assets. It can be rendered in-place, or to a specific element using the
// helper method.
//
// To render the library inline in html:
Function Page
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
function () {
var settings,
pageId,
pageData,
Function SlicesController
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
controller: function SlicesController() {
// private vars
var settings,
busy = true;
- 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 onPageLoaded
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onPageLoaded() {
var tabControls = $('#container-tab-controls'),
containersHolder = $('#containers-holder').empty(),
addSliceFields = $('#add-slice-fields');
AttachmentComposerView
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
slices.AttachmentComposerView = Backbone.View.extend({
DROP_THRESHOLD: 15,
views: {}, // internal view cache
Class Page
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Page
include Mongoid::Document
include Mongoid::Timestamps
include MongoSearch::Searchable
Function addSliceTemplate
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addSliceTemplate(slice) {
var templateData = {},
sliceBlock,
sliceContent,
sliceContentTemplate = slices.availableSlices[slice.type].template,
Class Asset
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Asset
include Mongoid::Document
include Mongoid::Timestamps
include MongoSearch::Searchable
include Mongoid::Paperclip
Function onFormSubmitted
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onFormSubmitted(event) {
event.preventDefault();
busy = true;
Function thumbPress
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
thumbPress: function(event, thumb) {
_.invoke(this.selection, 'deselect');
if (event.shiftKey) {
if (this.selection.length === 0) {
- 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 save
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function save() {
var dfd = $.Deferred();
var params = $.extend({}, pageData);
Method update_attributes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def update_attributes(attributes)
attributes = attributes.symbolize_keys
unless home?
if attributes.has_key?(:name) || attributes.has_key?(:permalink)
- 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 countMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
countMessage: function() {
var t = this.countMessages,
total = this.collection.totalEntries,
count = this.collection.length;
- 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 body
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
body: function() {
var data = [],
today = moment().startOf('day'),
thisMonth = this.month.clone(),
nextMonth = thisMonth.clone().add('months', 1),
- 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 thumbPress
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
thumbPress: function(event, thumb) {
_.invoke(this.selection, 'deselect');
if (event.shiftKey) {
if (this.selection.length === 0) {
Function editinplace
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.editinplace = function (settings) {
this.find('textarea,input[type=text]').each(
function () {
var ta = $(this);
var val = ta.val();
Function addSliceContainers
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addSliceContainers() {
_.each(slices.availableContainers, function (container, machineName) {
$('#container-' + machineName + ' ul').empty();
});