Showing 108 of 803 total issues
File hardware_server.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class HardwareServer < ActiveRecord::Base
include ApplicationHelper
attr_accessible :host, :auth_key, :description, :daemon_port, :use_ssl
validates_uniqueness_of :host
Method create_backup
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.create_backup(virtual_server, ve_state, description)
orig_ve_state = virtual_server.state
if 'running' == orig_ve_state
case ve_state
when 'suspend' then virtual_server.suspend
- 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 stat_details
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
def stat_details
@virtual_server = VirtualServer.find_by_id(params[:id])
redirect_to :controller => 'dashboard' and return if !@virtual_server or !@current_user.can_control(@virtual_server)
@up_level = '/admin/virtual-servers/show?id=' + @virtual_server.id.to_s
- 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 ext-lang-pl.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
Method owp_CreateAccount
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function owp_CreateAccount($params)
{
# ** The variables listed below are passed into all module functions **
$serviceid = $params["serviceid"]; # Unique ID of the product/service in the WHMCS Database
File ext-lang-pt_PT.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-hu.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-el_GR.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-fi.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-tr.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-pt_BR.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-id.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
Method save_physically
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def save_physically
return false if !valid?
is_new = new_record?
if is_new
File ext-lang-it.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-cs.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-th.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-da.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-no_NN.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-he.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
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-no_NB.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license