Showing 419 of 859 total issues
Function _create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
this.originalCss = {
display: this.element[0].style.display,
width: this.element[0].style.width,
minHeight: this.element[0].style.minHeight,
Function _initSource
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initSource: function() {
var array, url,
that = this;
if ( $.isArray(this.options.source) ) {
array = this.options.source;
Function values
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
values: function( index, newValue ) {
var vals,
newValues,
i;
Function save
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
save: function() {
// setup our params
var root = this.get('model.constructor.modelName').pluralize().underscore(),
data = this.get('model').serialize(),
hash = {};
Function usernameProblems
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
usernameProblems: function () {
var messages = [];
var username = this.get('username');
var blacklist = [ 'admin', 'administrator', 'connect', 'dashboard', 'developer', 'developers',
'edit', 'favorites', 'feature', 'featured', 'features', 'feed', 'follow', 'followers',
Function usernameProblems
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
usernameProblems: function() {
var messages = [];
var username = this.get('currentUser.newUsername');
var blacklist = [ 'admin', 'administrator', 'connect', 'dashboard', 'developer', 'developers',
'edit', 'favorites', 'feature', 'featured', 'features', 'feed', 'follow', 'followers',
Method rating_description
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def rating_description(r)
return "Pathetic" if r == 1
return "Dreadful" if r == 2
return "Poor" if r == 3
return "Mediocre" if r == 4
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create
authenticate_user!
@anime = Anime.find(params[:anime_id])
@review = Review.find_by_user_id_and_anime_id(current_user.id, @anime.id)
- 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 current_user
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def current_user
return env['current_user'] if env.has_key?('current_user')
if params[:auth_token] || cookies[:auth_token]
token = Token.new(params[:auth_token] || cookies[:auth_token])
- 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 from_action
has a Cognitive Complexity of 10 (exceeds 5 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]
- 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 broadcast
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.broadcast(data)
if data[:action_type] == "created_profile_comment"
# Create the story and substory for this action,
# TODO: generate notifications
# and return the story.
- 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 _checkUpdatedKeys
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _checkUpdatedKeys(){
var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)),
newCrc32List;
_reloadData();
Function getDimensions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDimensions( elem ) {
var raw = elem[0];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
Function moveToPoint
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Flipsnap.prototype.moveToPoint = function(point, transitionDuration) {
var self = this;
transitionDuration = transitionDuration === undefined
? self.transitionDuration : transitionDuration + 'ms';
Function moveToPoint
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Flipsnap.prototype.moveToPoint = function(point, transitionDuration) {
var self = this;
transitionDuration = transitionDuration === undefined
? self.transitionDuration : transitionDuration + 'ms';
Function buildTree
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildTree(tokens, kind, stack, customTags) {
var instructions = [],
opener = null,
token = null;
Function left
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
Function top
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
Function _updateVirtualBoundaries
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_updateVirtualBoundaries: function(forceAspectRatio) {
var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
o = this.options;
b = {
Function stop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
stop: function( event ) {
var that = $(this).data("ui-resizable"),
o = that.options,
pr = that._proportionallyResizeElements,
ista = pr.length && (/textarea/i).test(pr[0].nodeName),