Showing 419 of 859 total issues
Function next
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) this.done = true;
Function init
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Flipsnap.prototype.init = function(element, opts) {
var self = this;
// set element
self.element = element;
Function init
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Flipsnap.prototype.init = function(element, opts) {
var self = this;
// set element
self.element = element;
Function _setOption
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function( key, value ) {
/*jshint maxcomplexity:15*/
var isDraggable, isResizable,
uiDialog = this.uiDialog;
Function _setOption
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function( key, value ) {
var i,
valsLength = 0;
if ( key === "range" && this.options.range === true ) {
Function _toggle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_toggle: function( event, eventData ) {
var that = this,
toShow = eventData.newPanel,
toHide = eventData.oldPanel;
Function _mouseCapture
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseCapture: function( event ) {
var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
that = this,
o = this.options;
Function _animate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_animate: function( toShow, toHide, data ) {
var total, easing, duration,
that = this,
adjust = 0,
down = toShow.length &&
Function _determineDate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_determineDate: function(inst, date, defaultDate) {
var offsetNumeric = function(offset) {
var date = new Date();
date.setDate(date.getDate() + offset);
return date;
Function formattedAirDates
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
formattedAirDates: function() {
var format, formattedFinishedAiring, formattedStartedAiring, result;
if (this.get('startedAiring')) {
format = this.get('startedAiringDateKnown') ? "D MMM YYYY" : "MMM YYYY";
- 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 as_json
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def as_json
resource_fields = {}
linked = {}
json = {
title => resource_fields,
- 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 changes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
changes: function() {
var html = [];
var objectChanges = this.get('model.objectChanges');
var code;
- 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 import!
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def import!
en, jp = fetch_series(all: true), fetch_series(lang: 'ja') || {}
raise MissingDataError.new if en.nil? || en[:episode].blank?
# Save the jp anime title.
- 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 set
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
set: function(key, val, options) {
var attr, attrs, unset, changes, silent, changing, prev, current;
if (key == null) return this;
// Handle both `"key", value` and `{key: value}` -style arguments.
Function resize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
resize: function() {
var that = $(this).data("ui-resizable"),
o = that.options,
cs = that.size,
os = that.originalSize,
Function _generatePosition
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
_generatePosition: function(event) {
var top, left,
o = this.options,
pageX = event.pageX,
Method from_action
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.from_action(data)
user = User.find data[:user_id]
if data[:action_type] == "followed"
followed_user = User.find data[:followed_id]
Function set
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
set: function(models, options) {
options = _.defaults(options || {}, setOptions);
if (options.parse) models = this.parse(models, options);
if (!_.isArray(models)) models = models ? [models] : [];
var i, l, model, attrs, existing, sort;
Function getParseRegexForToken
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getParseRegexForToken(token) {
switch (token) {
case 'DDDD':
return parseTokenThreeDigits;
case 'YYYY':
Function _tabKeydown
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_tabKeydown: function( event ) {
/*jshint maxcomplexity:15*/
var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
selectedIndex = this.tabs.index( focusedTab ),
goingForward = true;