Showing 248 of 368 total issues
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render: function() {
$template = $('#instanceCardTemplate');
if($template.length === 0) return;
var $instances = this.$('ul.instances-array');
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(instance, assembly_uuids, config_values, deployable_id, deployable_name, config_server)
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
@base_image = Tim::BaseImage.new(params[:base_image]) unless defined? @base_image
if params[:back]
render :edit_xml
- 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 show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def show
@provider_realm = ProviderRealm.find(params[:id])
@title = @provider_realm.name
@tab_captions = [_('Properties'), _('Mapping')]
- 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
Avoid deeply nested control flow statements. Open
event4 = Event.new(:source => instance.deployment, :event_time => DateTime.now,
:status_code => "some_stopped", :summary => "Some instances are stopped",
:change_hash => instance.changes) if instance.deployment.events.lifetime.last{|e|e.status_code == :all_running}
Method uptime_1st_instance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def uptime_1st_instance
return nil if events.empty?
first_running = events.find_last_by_status_code(:first_running)
if instances.deployed.empty?
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def destroy
deployment = Deployment.find(params[:id])
cant_stop = false
errors = []
begin
- 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 transform_credential_definitions_back
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.transform_credential_definitions_back
ec2 = ProviderType.find_by_codename('ec2')
CredentialDefinition.all.each do |cred|
if cred.provider_type != ec2
if cred.name == 'username'
- 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 transform_credential_definitions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.transform_credential_definitions
ec2 = ProviderType.find_by_codename('ec2')
CredentialDefinition.all.each do |cred|
if cred.provider_type != ec2
if cred.name == 'username'
- 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
Avoid deeply nested control flow statements. Open
if Role.exists?(params[key])
MetadataObject.set(key, Role.find(params[key]))
end
Method show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def show
@realm = FrontendRealm.find(params[:id])
@title = @realm.name
@tab_captions = [_('Properties'), _('Mapping')]
@details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
- 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_destroy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def multi_destroy
deleted=[]
not_deleted=[]
HardwareProfile.find(params[:hardware_profile_selected]).each do |hwp|
- 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 restful_submit_tag
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def restful_submit_tag(value, action, url, method, options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, description, executable, files, parameters)
Method build_from_deployable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.build_from_deployable(permission_session, user, pool, deployable_xml, frontend_realm = nil)
Method validate_task
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_task
errors.add("created_at", "Task started but does not have the creation time set") if time_started and created_at.nil?
# Removed check on time_started exisiting. if time_ended does. This can now occur, when the task fails before is starts. e.g. When Over Qutoa
#errors.add("time_started", "Task ends but does not have the start time set") if time_ended and time_started.nil?
errors.add("time_ended", "Tasks ends before it's started") unless time_ended.nil? or time_started.nil? or time_ended >= time_started
- 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 imagefactory_info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def imagefactory_info
if provider_type.deltacloud_driver == 'openstack'
# TODO: We might want to pull this up to the Provider, really
acct = provider_accounts.first
uri = URI.parse(acct.credentials_hash['glance_url'])
- 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 authenticate_using_ldap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.authenticate_using_ldap(username, password, ipaddress)
if Ldap.valid_ldap_authentication?(username, password)
u = User.find_by_username(username) || create_ldap_user!(username)
update_login_attributes(u, ipaddress)
else
- 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 image_valid?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def image_valid?(assembly, modify_perm)
edit_xml_path = edit_polymorphic_path([@catalog, @deployable], :edit_xml => true)
if @missing_images.empty? && assembly[:hwp_name].present?
link_hash = {:label => '.images_valid', :class => 'images_valid'}
- 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 create_instance!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.create_instance!(task, match, config_server, config)
begin
task.state = Task::STATE_PENDING
task.save!
- 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"