Showing 583 of 2,698 total issues
File organization_quotas_spec.rb
has 613 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'request_spec_shared_examples'
module VCAP::CloudController
RSpec.describe 'organization_quotas' do
File validators_spec.rb
has 605 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'lightweight_spec_helper'
require 'messages/validators'
require 'messages/base_message'
require 'messages/empty_lifecycle_data_message'
File app_usage_event_repository_spec.rb
has 594 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'repositories/app_usage_event_repository'
module VCAP::CloudController
module Repositories
File seeds_spec.rb
has 583 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'cloud_controller/seeds'
module VCAP::CloudController
RSpec.describe VCAP::CloudController::Seeds do
File encryptor_spec.rb
has 572 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
module VCAP::CloudController
RSpec.describe Encryptor do
let(:salt) { Encryptor.generate_salt }
File 20230725110800_restructure_index_for_improved_pagination_order.rb
has 566 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
Sequel.migration do
index_migration_data = [
# CREATED AT
{
table: :organizations,
File staging_action_builder_spec.rb
has 555 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
module VCAP::CloudController
module Diego
module Buildpack
File config_spec.rb
has 554 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
module VCAP::CloudController
RSpec.describe Config do
let(:test_config_hash) do
File process_update_message_spec.rb
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'messages/process_update_message'
require 'messages/metadata_base_message'
module VCAP::CloudController
File broker_api_v2.15_spec.rb
has 528 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
RSpec.describe 'Service Broker API integration' do
describe 'v2.15' do
include VCAP::CloudController::BrokerApiHelper
File dashboard_client_manager_spec.rb
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
module VCAP::Services::SSO
RSpec.describe DashboardClientManager do
let(:client_manager) { double('client_manager') }
File syslog_drain_urls_controller_spec.rb
has 505 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
## NOTICE: Prefer request specs over controller specs as per ADR #0003 ##
module VCAP::CloudController
File buildpacks_spec.rb
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'messages/buildpack_upload_message'
require 'request_spec_shared_examples'
RSpec.describe 'buildpacks' do
File stagings_controller_spec.rb
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
## NOTICE: Prefer request specs over controller specs as per ADR #0003 ##
module VCAP::CloudController
File isolation_segments_spec.rb
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'isolation_segment_assign'
require 'request_spec_shared_examples'
RSpec.describe 'IsolationSegmentModels' do
File process_model.rb
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'cloud_controller/process_observer'
require 'cloud_controller/database_uri_generator'
require 'cloud_controller/errors/application_missing'
require 'repositories/app_usage_event_repository'
require 'presenters/v3/cache_key_presenter'
File uaa_token_decoder_spec.rb
has 452 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'cloud_controller/uaa/uaa_token_decoder'
module VCAP::CloudController
RSpec.describe UaaTokenDecoder do
File space_diff_manifest_spec.rb
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'spec_helper'
require 'actions/space_diff_manifest'
module VCAP::CloudController
RSpec.describe SpaceDiffManifest do
Method update
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.update(quota, message)
if log_rate_limit(message) != QuotaDefinition::UNLIMITED
orgs = orgs_with_unlimited_processes(quota)
unlimited_processes_exist_error!(orgs) if orgs.any?
end
- 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 stemmer
has 166 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lunr.stemmer = (function(){
var step2list = {
"ational" : "ate",
"tional" : "tion",
"enci" : "ence",