Showing 248 of 368 total issues
Method validate_hwp
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_hwp
case name
when MEMORY
unless unit == UNIT_MB
errors.add(:unit, "Memory must be specified in MB")
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var $template = this.template();
if (this.currentView() == 'table') {
var $table = this.$('table.checkbox_table > tbody');
Method add_provider_accounts
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_provider_accounts
@pool_family = PoolFamily.find(params[:id])
require_privilege(Alberich::Privilege::MODIFY, @pool_family)
if ProviderAccount.count == 0
Method update_cost
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_cost
redirect_to hardware_profiles_path unless params[:id]
@hardware_profile = HardwareProfile.find(params[:id])
require_privilege(Alberich::Privilege::MODIFY, @hardware_profile)
Method send_launch_requests
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def send_launch_requests(all_inst_match, instance_ids, config_server_id, user_id)
user = User.find(user_id)
instances = instance_ids.map{|instance_id| Instance.find(instance_id)}
if config_server_id.nil?
- 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 remove_provider_accounts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def remove_provider_accounts
@pool_family = PoolFamily.find(params[:id])
require_privilege(Alberich::Privilege::MODIFY, @pool_family)
removed=[]
not_removed=[]
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def index
clear_breadcrumbs
save_breadcrumb(logs_path)
params[:view] = "filter" if params[:view].nil?
- 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 generate_override_property_value
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.generate_override_property_value(front_end_property, back_end_property)
case back_end_property.kind
when "fixed"
return back_end_property.value
when "range"
- 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 multi_stop
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def multi_stop
notices = []
errors = []
@instances_to_stop.each do |instance|
- 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 build_assembly_match
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_assembly_match
@assembly_matches = []
assembly_level_warnings = []
@errors = []
- 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 update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update
@title = _('Edit User')
@user = params[:id] ? User.find(params[:id]) : current_user
require_privilege(Alberich::Privilege::MODIFY, User) unless @user == current_user
# A user should not be able to edit their own quota:
- 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 update_cost
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update_cost
redirect_to hardware_profiles_path unless params[:id]
@hardware_profile = HardwareProfile.find(params[:id])
require_privilege(Alberich::Privilege::MODIFY, @hardware_profile)
- 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 launch_time_params
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch_time_params
@title = _('New Deployment')
@deployment = Deployment.new(params[:deployment])
@pool = @deployment.pool
Method destroy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def destroy
deployment = Deployment.find(params[:id])
cant_stop = false
errors = []
begin
Method after_update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def after_update(instance)
# This can get stale, so reload it -- if it exists
instance.deployment.reload if instance.deployment
if instance.state_changed?
event = Event.new(:source => instance, :event_time => DateTime.now,
Method up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def up
create_table :alberich_entities do |t|
t.string :name
t.references :entity_target, :polymorphic => true, :null => false
Method up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.up
return if Role.all.empty?
Role.transaction do
role = Role.find_or_initialize_by_name(ROLE_NAME)
Method add_members
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_members
@user_group = UserGroup.find(params[:id])
require_privilege(Alberich::Privilege::MODIFY, User)
unless @user_group.membership_source == UserGroup::MEMBERSHIP_SOURCE_LOCAL
Method index
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
clear_breadcrumbs
if params[:catalog_id].present?
save_breadcrumb(catalog_deployables_path(:viewstate => @viewstate ? @viewstate.id : nil))
@catalog = Catalog.find(params[:catalog_id])
Method create
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
@title = _('New Provider')
require_privilege(Alberich::Privilege::CREATE, Provider)
@provider = Provider.new(params[:provider])