Showing 108 of 803 total issues
File ext-lang-hr.js
has 255 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
Method sync_virtual_servers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def sync_virtual_servers
ves_on_server = rpc_client.exec('vzlist', '-a -H -o veid,hostname,ip,status')['output'].split("\n")
# skip error lines
ves_on_server = ves_on_server.find_all{ |item| item =~ /^\s*\d+/ }
- 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 get_usage_stats
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_usage_stats(virtual_server)
is_running = 'running' == virtual_server.real_state
stats = []
Method new
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def new
@available_locales = I18n.available_locales.map {
|locale| [locale.to_s, I18n.t('language.title', :locale => locale) + " (#{locale})"]
}.sort
Method get_usage_stats
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_usage_stats(virtual_server)
is_running = 'running' == virtual_server.real_state
stats = []
File ext-lang-ro.js
has 253 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
Method install
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def install
hardware_server = HardwareServer.find_by_id(params[:hardware_server_id])
render(:json => { :success => false }) and return if !hardware_server
jobs_ids = []
- 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 groupAction
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Owp.list.groupAction = function(config) {
config = Ext.apply({
gridName: '',
url: '',
command: '',
Method get_usage_stats
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_usage_stats(hardware_server)
stats = []
os_version = hardware_server.os_version
stats << {
Function action
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Owp.button.action = function(config) {
config = Ext.apply({
gridName: '',
url: '',
command: '',
Method stat_details
has 42 lines of code (exceeds 25 allowed). Consider refactoring. 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
Method restore
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def restore
orig_ve_state = virtual_server.state
virtual_server.stop if 'running' == orig_ve_state
job_id = restore_now['job_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 virtual_server_properties
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def virtual_server_properties(virtual_server)
params = [
{
:parameter => t('admin.virtual_servers.form.create_server.field.identity'),
:value => virtual_server.identity,
Method reset_password
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def reset_password
if params.key?(:user_id) and params.key?(:hash)
user = User.find(params[:user_id])
if user
hash = Digest::SHA1.hexdigest(user.crypted_password + user.login)
- 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 errorHandler
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Owp.form.errorHandler = function(form, action, params) {
if ('client' == action.failureType) {
return
}
Method install_daemon
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_daemon(root_password)
if root_password.blank?
self.errors.add :root_password, :empty
return false
end
Method sync_virtual_servers
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sync_virtual_servers
ves_on_server = rpc_client.exec('vzlist', '-a -H -o veid,hostname,ip,status')['output'].split("\n")
# skip error lines
ves_on_server = ves_on_server.find_all{ |item| item =~ /^\s*\d+/ }
Method profile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def profile
@page_title = t('admin.my_profile.title')
if request.post?
if !params[:password].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 sync_backups
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sync_backups
backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output']
backups_list = backups_list.split("\n")
# remove totals line
backups_list.shift
- 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 brMoney
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Ext.util.Format.brMoney = function(v){
v = (Math.round((v - 0) * 100)) / 100;
v = (v == Math.floor(v)) ? v + ".00" : ((v * 10 == Math.floor(v * 10)) ? v + "0" : v);
v = String(v);
var ps = v.split('.');
- 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"