cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub
bosh_cli/lib/cli/commands/release.rb

Summary

Maintainability
F
3 days
Test Coverage

File release.rb has 563 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Bosh::Cli::Command
  class Release < Base
    DEFAULT_RELEASE_NAME = 'bosh-release'

    include Bosh::Cli::DependencyHelper
Severity: Major
Found in bosh_cli/lib/cli/commands/release.rb - About 1 day to fix

    Class Release has 34 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Release < Base
        DEFAULT_RELEASE_NAME = 'bosh-release'
    
        include Bosh::Cli::DependencyHelper
    
    
    Severity: Minor
    Found in bosh_cli/lib/cli/commands/release.rb - About 4 hrs to fix

      Method upload_tarball has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def upload_tarball(tarball_path, upload_options = {})
            tarball = Bosh::Cli::ReleaseTarball.new(tarball_path)
            # Trying to repack release by default
            repack = upload_options[:repack]
            rebase = upload_options[:rebase]
      Severity: Minor
      Found in bosh_cli/lib/cli/commands/release.rb - About 2 hrs to fix

      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 upload_tarball has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def upload_tarball(tarball_path, upload_options = {})
            tarball = Bosh::Cli::ReleaseTarball.new(tarball_path)
            # Trying to repack release by default
            repack = upload_options[:repack]
            rebase = upload_options[:rebase]
      Severity: Major
      Found in bosh_cli/lib/cli/commands/release.rb - About 2 hrs to fix

        Method create has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def create(manifest_file = nil)
              check_if_release_dir
        
              if manifest_file && File.file?(manifest_file)
                if options[:version]
        Severity: Minor
        Found in bosh_cli/lib/cli/commands/release.rb - About 1 hr to fix

        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 upload has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def upload(release_file = nil)
              auth_required
        
              upload_options = {
                :rebase => options[:rebase],
        Severity: Minor
        Found in bosh_cli/lib/cli/commands/release.rb - About 1 hr to fix

        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_from_spec has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def create_from_spec(version)
              final = options[:final]
              force = options[:force]
              manifest_only = !options[:with_tarball]
              dry_run = options[:dry_run]
        Severity: Minor
        Found in bosh_cli/lib/cli/commands/release.rb - About 1 hr to fix

        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_from_spec has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def create_from_spec(version)
              final = options[:final]
              force = options[:force]
              manifest_only = !options[:with_tarball]
              dry_run = options[:dry_run]
        Severity: Minor
        Found in bosh_cli/lib/cli/commands/release.rb - About 1 hr to fix

          Method show_summary has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def show_summary(builder)
                packages_table = table do |t|
                  t.headings = %w(Name Version Notes)
                  builder.packages.each do |package|
                    t << artefact_summary(package)
          Severity: Minor
          Found in bosh_cli/lib/cli/commands/release.rb - About 1 hr to fix

            Method upload has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def upload(release_file = nil)
                  auth_required
            
                  upload_options = {
                    :rebase => options[:rebase],
            Severity: Minor
            Found in bosh_cli/lib/cli/commands/release.rb - About 1 hr to fix

              Method save_dev_release_name has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def save_dev_release_name
                    if interactive?
                      release.dev_name = ask('Please enter development release name: ') do |q|
                        q.default = release.final_name if release.final_name
                      end.to_s
              Severity: Minor
              Found in bosh_cli/lib/cli/commands/release.rb - About 1 hr to fix

              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_release has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def build_release(dry_run, final, jobs, manifest_only, packages, version)
              Severity: Minor
              Found in bosh_cli/lib/cli/commands/release.rb - About 45 mins to fix

                Method release_version_details has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def release_version_details(releases)
                      currently_deployed = false
                      uncommitted_changes = false
                      releases.each do |release|
                        release['release_versions'].each do |version|
                Severity: Minor
                Found in bosh_cli/lib/cli/commands/release.rb - About 25 mins to fix

                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_releases_table_for_old_director has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def build_releases_table_for_old_director(releases)
                      table do |t|
                        t.headings = 'Name', 'Versions'
                        releases.each do |release|
                          versions = release['versions'].sort { |v1, v2|
                Severity: Minor
                Found in bosh_cli/lib/cli/commands/release.rb - About 25 mins to fix

                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

                There are no issues that match your filters.

                Category
                Status