Showing 108 of 803 total issues
Method save_physically
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def save_physically
return false if !valid?
is_new = new_record?
if is_new
- 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 32 (exceeds 5 allowed). Consider refactoring. Open
def new
@available_locales = I18n.available_locales.map {
|locale| [locale.to_s, I18n.t('language.title', :locale => locale) + " (#{locale})"]
}.sort
- 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
File watchdog.rb
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'drb/drb'
require 'date'
require 'ostruct'
CURRENT_DIR = File.expand_path(File.dirname(__FILE__)) + '/'
File virtual_server.rb
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
class VirtualServer < ActiveRecord::Base
attr_accessible :identity, :ip_address, :host_name, :hardware_server_id,
:orig_os_template, :password, :start_on_boot, :start_after_creation, :state,
:nameserver, :search_domain, :diskspace, :memory, :password_confirmation,
:user_id, :orig_server_template, :description, :cpu_units, :cpus, :cpu_limit,
Method save_physically
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def save_physically
return false if !valid?
content = ""
content << 'ONBOOT="' + (start_on_boot ? "yes" : "no") + '"' + "\n"
- 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
Class VirtualServer
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class VirtualServer < ActiveRecord::Base
attr_accessible :identity, :ip_address, :host_name, :hardware_server_id,
:orig_os_template, :password, :start_on_boot, :start_after_creation, :state,
:nameserver, :search_domain, :diskspace, :memory, :password_confirmation,
:user_id, :orig_server_template, :description, :cpu_units, :cpus, :cpu_limit,
File virtual_servers_controller.rb
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
include ActionView::Helpers::TextHelper
class Admin::VirtualServersController < Admin::Base
before_filter :superadmin_required, :only => [:list_data, :delete, :create, :clone, :migrate]
before_filter :set_server_by_id, :only => [ :clone, :migrate, :create_template, :get_properties, :get_stats, :get_limits ]
File ext-lang-fr.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-en.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-de.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-lt.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File application.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Ext.BLANK_IMAGE_URL = BASE_URL + '/images/blank.gif';
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
Ext.Ajax.timeout = 30 * 60 * 1000;
Class VirtualServersController
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Admin::VirtualServersController < Admin::Base
before_filter :superadmin_required, :only => [:list_data, :delete, :create, :clone, :migrate]
before_filter :set_server_by_id, :only => [ :clone, :migrate, :create_template, :get_properties, :get_stats, :get_limits ]
def list
Class HardwareServer
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class HardwareServer < ActiveRecord::Base
include ApplicationHelper
attr_accessible :host, :auth_key, :description, :daemon_port, :use_ssl
validates_uniqueness_of :host
File ext-lang-ru.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-nl.js
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-en_GB.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-es.js
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-ja.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-ca.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license