Showing 3,486 of 3,486 total issues
Function _validateFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_validateFile: function(file){
var name, size;
if (file.value){
// it is a file input
- 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 constructor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
constructor: function(config){
Talho.FindPeople.superclass.constructor.call(this, config);
this.admin_mode = config.admin_mode;
this.rolesStore = new Ext.data.JsonStore({
- 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 index
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def index
urls = params[:urls].to_a.reject{|u| u.blank?}
urls.each{|u| u.insert(0, "http://") } #clean up urls to ensure they're lead by http://
feed = Feedzirra::Feed.fetch_and_parse(urls) unless urls.blank?
sleep 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
Method destroy
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def destroy
role_assignment = RoleMembership.find(params[:id])
if role_assignment.blank?
flash[:error] = "Invalid role membership specified"
if session[:return_to].blank?
- 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 new
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.new( attributes = {}, options = {} )
shared_attr = attributes[:shared]
attributes.delete(:shared)
audience_attr = attributes[:audience]
attributes.delete(:audience)
- 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 choose_layout
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def choose_layout
if signed_in?
if request.xhr? || request.format.ext?
if request.format.json?
false
- 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 moveItem
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
moveItem: function(mode){
var sel = this.current_selections[0];
var type = sel.get('type');
if(sel.get('id') == null || sel.get('id') == 'null') return;
Function showFiles
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
showFiles: function(record){
var store = new Talho.ux.Documents.FileStore({
url: '/folders/' + record.get('id') + '.json',
autoLoad: true,
listeners: {
Function initComponent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComponent: function(){
this.addEvents('back');
this.group_detail_panel = new Ext.Panel({
layout: 'form',
Function _sort
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sort : function(property, dir, fn){
var i, len,
dsc = String(dir).toUpperCase() == 'DESC' ? -1 : 1,
//this is a temporary array used to apply the sorting function
Function removeChild
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeChild : function(node, destroy){
var index = this.childNodes.indexOf(node);
if(index == -1){
return false;
}
Function sortData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
sortData : function() {
var sortInfo = this.hasMultiSort ? this.multiSortInfo : this.sortInfo,
direction = sortInfo.direction || "ASC",
sorters = sortInfo.sorters,
sortFns = [];
Function bindStore
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindStore : function(store, initial){
var doLoad;
if(!initial && this.store){
if(store !== this.store && this.store.autoDestroy){
this.store.destroy();
Function testPlayerVersion
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function testPlayerVersion() {
var b = doc.getElementsByTagName("body")[0];
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
var t = b.appendChild(o);
Function getNextCell
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
getNextCell : function(c){
var cell = this.getNextNonSpan(this.currentColumn, this.currentRow);
var curCol = this.currentColumn = cell[0], curRow = this.currentRow = cell[1];
for(var rowIndex = curRow; rowIndex < curRow + (c.rowspan || 1); rowIndex++){
if(!this.cells[rowIndex]){
Function processEvent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
processEvent : function(name, e) {
var target = e.getTarget(),
grid = this.grid,
header = this.findHeaderIndex(target),
row, cell, col, body;
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor : function(grid, store){
var g = Ext.grid,
f = Ext.form;
this.grid = grid;
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor: function(elId, config) {
config = config || {};
Ext.apply(this, config);
Ext.ux.Carousel.superclass.constructor.call(this, config);
Function realign
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
realign: function(l, t, w, h) {
if (!this.el) {
return;
}
var a = this.adjusts,
Function createScrollers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
createScrollers : function(){
if(!this.scroller){
this.scroller = {
pos: 0,
top: this.el.insertFirst({