orange-cloudfoundry/cf-ops-automation

View on GitHub

Showing 954 of 956 total issues

Class has too many lines. [155/100]
Open

    class Git < Base
      include Coa::Constants

      CREDENTIALS_AUTO_INIT_PATH = "#{SECRETS_REPO_DIR}/coa/config/credentials-auto-init.yml".freeze
      GIT_CONFIG_PATH            = "#{SECRETS_REPO_DIR}/coa/config/credentials-git-config.yml".freeze
Severity: Minor
Found in lib/coa/env_bootstrapper/git.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [151/100]
Open

class SharedPipelineGenerator
  attr_reader :options, :warnings
  attr_accessor :erb_context

  alias :ctxt :erb_context
Severity: Minor
Found in lib/shared_pipeline_generator.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [137/100]
Open

class RepackageReleasesFallback
  BOSH_IO_PREFIX = "https://bosh.io/d/github.com".freeze
  GITHUB_PREFIX = "https://github.com".freeze

  def initialize(repackaged_error_filepath = "")

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for set_context is too high. [83.39/15]
Open

  def set_context
    shared_config  = File.join(options.paas_templates_path, 'shared-config.yml')
    private_config = File.join(options.secrets_path, 'private-config.yml')
    profiles = if options.profiles_auto_sort
                 options.profiles.sort
Severity: Minor
Found in lib/shared_pipeline_generator.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Class has too many lines. [121/100]
Open

class PipelineGenerator
  attr_reader :options, :warnings
  attr_accessor :erb_context

  include CoaRunLogger
Severity: Minor
Found in lib/pipeline_generator.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for set_context is too high. [81.75/15]
Open

  def set_context
    shared_config  = File.join(options.paas_templates_path, 'shared-config.yml')
    private_config = File.join(options.secrets_path, 'private-config.yml')
    profiles = if options.profiles_auto_sort
                 options.profiles.sort
Severity: Minor
Found in lib/pipeline_generator.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Class has too many lines. [117/100]
Open

class RepackageReleases
  def initialize(root_deployment, missing_s3_releases = {}, list_releases = Tasks::Bosh::ListReleases.new, create_release = Tasks::Bosh::CreateRelease.new)
    raise "Invalid root_deployment object" unless root_deployment.respond_to?(:release_version) && root_deployment.respond_to?(:releases_git_urls) && root_deployment.respond_to?(:release)

    @root_deployment = root_deployment

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [109/100]
Open

class DeploymentFactory
  attr_reader :version_reference, :root_deployment_name, :config

  include CoaRunLogger
  def initialize(root_deployment_name, version_reference = {}, config = Config.new)
Severity: Minor
Found in lib/deployment_factory.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [47/10]
Open

def migrate_to_root_deployment_yml(paas_template_root)
  root_deployment_migrated = 0
  incomplete_releases = {}
  root_deployments_path = Dir["#{paas_template_root}/*-depls"]
  puts root_deployments_path

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for insert_pipeline_config is too high. [46.27/15]
Open

def insert_pipeline_config(ci_deployment_overview)
  migrated = false
  ci_deployment_overview['ci-deployment']&.each do |_, details|
    additional_pipelines = {}
    details['pipelines']&.select { |name, _| name.end_with?('-init-generated') }
Severity: Minor
Found in upgrade/v3.2.0/01-upgrade-config.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for migrate_to_root_deployment_yml is too high. [46.37/15]
Open

def migrate_to_root_deployment_yml(paas_template_root)
  root_deployment_migrated = 0
  incomplete_releases = {}
  root_deployments_path = Dir["#{paas_template_root}/*-depls"]
  puts root_deployments_path

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [40/10]
Open

      def option_parser(options)
        OptionParser.new do |opts|
          opts.banner = "Incomplete/wrong parameter(s): #{opts.default_argv}.\n Usage: ./#{opts.program_name} <options>"

          opts.on('-d', '--depls ROOT_DEPLOYMENT', 'Specify a root deployment name to generate template for') do |deployment_string|
Severity: Minor
Found in lib/shared_pipeline_generator.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [40/10]
Open

      def option_parser(options)
        OptionParser.new do |opts|
          opts.banner = "Incomplete/wrong parameter(s): #{opts.default_argv}.\n Usage: ./#{opts.program_name} <options>"

          opts.on('-d', '--depls ROOT_DEPLOYMENT', 'Specify a root deployment name to generate template for. MANDATORY') do |deployment_string|
Severity: Minor
Found in lib/pipeline_generator.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [38/10]
Open

  def set_context
    shared_config  = File.join(options.paas_templates_path, 'shared-config.yml')
    private_config = File.join(options.secrets_path, 'private-config.yml')
    profiles = if options.profiles_auto_sort
                 options.profiles.sort
Severity: Minor
Found in lib/shared_pipeline_generator.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Identical blocks of code found in 2 locations. Consider refactoring.
Open

def set_pipeline(target_name:, fly_bin: 'fly', team_name: 'main', name:, config:, load: [], options: [])
  if OPTIONS.key?(:match) && !name.include?(OPTIONS[:match])
    puts "Skipping pipeline loading, '--match' #{OPTIONS[:match]} exclude pipeline #{name}"
    return
  end
Severity: Major
Found in scripts/concourse-shared-pipelines-update.rb and 1 other location - About 4 hrs to fix
scripts/concourse-manual-pipelines-update.rb on lines 84..113

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 164.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

def set_pipeline(target_name:, fly_bin: 'fly', team_name: 'main', name:, config:, load: [], options: [])
  if OPTIONS.key?(:match) && !name.include?(OPTIONS[:match])
    puts "Skipping pipeline loading, '--match' #{OPTIONS[:match]} exclude pipeline #{name}"
    return
  end
Severity: Major
Found in scripts/concourse-manual-pipelines-update.rb and 1 other location - About 4 hrs to fix
scripts/concourse-shared-pipelines-update.rb on lines 80..109

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 164.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method has too many lines. [33/10]
Open

def insert_pipeline_config(ci_deployment_overview)
  migrated = false
  ci_deployment_overview['ci-deployment']&.each do |_, details|
    additional_pipelines = {}
    details['pipelines']&.select { |name, _| name.end_with?('-init-generated') }
Severity: Minor
Found in upgrade/v3.2.0/01-upgrade-config.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/10]
Open

  def process(repackaged_releases_path, base_git_clones_path, logs_path)
    errors = {}
    successfully_processed = []
    begin
      releases_not_uploaded_to_director = filter_releases

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for check_warnings is too high. [32.56/15]
Open

  def check_warnings
    warnings << "### WARNING ### no deployment detected. Please check\n template_dir: #{options.paas_templates_path}\n secrets_dir: #{options.secrets_path}" if ctxt.multi_root_dependencies&.empty?
    warnings << '### WARNING ### no ci deployment detected. Please check a valid ci-deployment-overview.yml exists' if ctxt.root_deployments.map { |name| ctxt.multi_root_ci_deployments&.empty? || ctxt.multi_root_ci_deployments[name]&.empty? }
                                                                                                                           .inject { |memo, element| memo && element }
    warnings << '### WARNING ### no cf app deployment detected. Please check a valid enable-cf-app.yml exists' if ctxt.multi_root_cf_apps&.empty?
Severity: Minor
Found in lib/shared_pipeline_generator.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for set_pipeline is too high. [30.43/15]
Open

def set_pipeline(target_name:, fly_bin: 'fly', team_name: 'main', name:, config:, load: [], options: [])
  if OPTIONS.key?(:match) && !name.include?(OPTIONS[:match])
    puts "Skipping pipeline loading, '--match' #{OPTIONS[:match]} exclude pipeline #{name}"
    return
  end

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Severity
Category
Status
Source
Language