Showing 419 of 859 total issues
Function graphData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
graphData: function() {
var data = this.get('model'),
labels = Object.keys(data["registrations"]["total"]),
confirmed = [],
total = [];
Function refresh
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
refresh: function() {
//See #8237 & #8828
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
if ( isDisabled !== this.options.disabled ) {
Function _setupHeightStyle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setupHeightStyle: function( heightStyle ) {
var maxHeight,
parent = this.element.parent();
if ( heightStyle === "fill" ) {
Function performSearch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
performSearch: function() {
if (this.get('loading')) {
Ember.run.later(this, this.performSearch, 100);
return;
}
Method stats
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def stats
stats = {}
stats[:activeaccs] = User.where('last_library_update >= ?', 1.day.ago).count
stats[:feedposts] = Story.where('created_at >= ?', 1.day.ago).count
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(environment) {
var ENV = {
modulePrefix: 'frontend',
environment: environment,
baseURL: '/',
Function retrieve
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, retrieve: function () {
if ( this.storage.has( this.path ) ) {
// if data expired, destroy it!
if ( this.options.expires ) {
Function equals
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
equals: function(other) {
var len = this.opcodes.length;
if (other.opcodes.length !== len) {
return false;
}
Function block
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
block: function(block) {
var mustache = block.mustache,
program = block.program,
inverse = block.inverse;
Function focus
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
focus: function( event, item ) {
var nested, focused;
this.blur( event, event && event.type === "focus" );
this._scrollIntoView( item );
Function _mouseStop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseStop: function(event) {
this.resizing = false;
var pr, ista, soffseth, soffsetw, s, left, top,
o = this.options, that = this;
Function resize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
resize: function (event, ui) {
var that = $(this).data("ui-resizable"),
o = that.options,
os = that.originalSize,
op = that.originalPosition,
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
create: function() {
var group = this.store.createRecord('group', {
name: this.get('name'),
bio: this.get('bio'),
about: this.get('about')
Consider simplifying this complex logical expression. Open
Open
if ($.datepicker._datepickerShowing) {
switch (event.keyCode) {
case 9: $.datepicker._hideDatepicker();
handled = false;
break; // hide on tab out
Function _generateMonthYearHeader
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
secondary, monthNames, monthNamesShort) {
Consider simplifying this complex logical expression. Open
Open
if((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
if(that._trigger("stop", event) !== false) {
that._clear();
}
Consider simplifying this complex logical expression. Open
Open
if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
}
Consider simplifying this complex logical expression. Open
Open
if ( this.options.tolerance === "pointer" ||
this.options.forcePointerForContainers ||
(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
) {
return isOverElement;
Method add!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def add!(story)
add_story = false
if story.story_type == "comment"
if story.group_id || @user == story.target || @user.following.include?(story.target)
add_story = 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
Method alternate_title
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def alternate_title(preference = '')
if preference.class == User
preference = preference.title_language_preference
end
- 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"