Showing 583 of 2,698 total issues
Method to_hash
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def to_hash
{
guid: usage_event.guid,
created_at: usage_event.created_at,
updated_at: usage_event.created_at,
Method advanced_filtering
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def advanced_filtering(message, dataset, klass)
advanced_filters = {}
advanced_filters['created_at'] = message.created_ats if message.requested?(:created_ats)
advanced_filters['updated_at'] = message.updated_ats if message.requested?(:updated_ats)
Method save_staging_result
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def save_staging_result(payload)
lifecycle_data = payload[:result][:lifecycle_metadata]
buildpack_key = nil
buildpack_url = nil
Method start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start
# add quit trap as in QuitTrap monkey patch
trap('QUIT') do
Thread.new { say 'Exiting...' }
stop
Method update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update(resource, labels, label_klass, destroy_nil: true)
starting_label_count_for_resource = label_klass.where(resource_guid: resource.guid).count
labels ||= {}
labels.each do |label_key, label_value|
Method decorate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def decorate(hash, service_instances)
managed_service_instances = service_instances.select(&:managed_instance?)
return hash if managed_service_instances.empty?
offerings = Service.
Method unique_blobstores
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def unique_blobstores
return @unique_blobstores if @unique_blobstores.present?
full_list = [
{
Method add_organization_role
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def add_organization_role(user_guid, relationship, org_guid)
organization = Organization.first(guid: org_guid)
user = User.first(guid: user_guid)
user.username = @uaa_username_lookup_client.usernames_for_ids([user.guid])[user.guid] || ''
Method filter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def filter(message, app, space_guids, dataset)
if message.requested?(:current) && app
dataset = dataset.extension(:null_dataset)
return dataset.nullify unless app.droplet
Method upload_buildpack
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def upload_buildpack(buildpack, bits_file_path, new_filename)
return false if buildpack.locked
sha256 = Digester.new(algorithm: OpenSSL::Digest::SHA256).digest_path(bits_file_path)
new_key = "#{buildpack.guid}_#{sha256}"
Method tables_for_vcap_relations_spec
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def tables_for_vcap_relations_spec
db.create_table :owners do
primary_key :id
String :guid, null: false, index: true
end
Method update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update(app, message, lifecycle)
validate_not_changing_lifecycle_type!(app, lifecycle)
app.db.transaction do
app.lock!
Method build_completed
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_completed(staging_guid)
staging_response = read_body
build = BuildModel.find(guid: staging_guid)
raise CloudController::Errors::ApiError.new_from_details('ResourceNotFound', 'Build not found') if build.nil?
Method validate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def validate(record)
unless record.rules.is_a?(Array)
record.errors.add :rules, 'must be an array'
return
end
Method to_hash
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def to_hash
hash = {
guid: app.guid,
created_at: app.created_at,
updated_at: app.updated_at,
Method validate_destination_contents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def validate_destination_contents
app_to_ports_hash = {}
destinations.each_with_index do |dst, index|
unless dst.is_a?(Hash)
Method action
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def action
download_droplet_action = ::Diego::Bbs::Models::DownloadAction.new(
from: lifecycle_data[:droplet_uri],
to: '.',
cache_key: '',
Method build_api_error_matcher
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_api_error_matcher(error_class, api_error_name, *api_error_args)
supports_block_expectations
match do |actual|
actual.call
Method define_message
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def define_message(type)
attrs = Array(attributes)
to_one = @to_one_relationships ||= []
to_many = @to_many_relationships ||= []
Function _createWidget
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;